mirror of
https://github.com/cubixle/codekata-golang.git
synced 2026-04-30 14:18:40 +01:00
update euler 206
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
func Test_isMatch(t *testing.T) {
|
||||
fn, _ := (&big.Int{}).SetString("10203040506070809", 0)
|
||||
fn2, _ := (&big.Int{}).SetString("10203040506070808", 0)
|
||||
type args struct {
|
||||
i *big.Int
|
||||
}
|
||||
@@ -22,6 +23,13 @@ func Test_isMatch(t *testing.T) {
|
||||
},
|
||||
true,
|
||||
},
|
||||
{
|
||||
"test2",
|
||||
args{
|
||||
fn2,
|
||||
},
|
||||
false,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
@@ -31,3 +39,50 @@ func Test_isMatch(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_isEndsWith37(t *testing.T) {
|
||||
type args struct {
|
||||
s string
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
want bool
|
||||
}{
|
||||
{
|
||||
"test1",
|
||||
args{
|
||||
"123",
|
||||
},
|
||||
true,
|
||||
},
|
||||
{
|
||||
"test2",
|
||||
args{
|
||||
"127",
|
||||
},
|
||||
true,
|
||||
},
|
||||
{
|
||||
"test3",
|
||||
args{
|
||||
"12",
|
||||
},
|
||||
false,
|
||||
},
|
||||
{
|
||||
"test4",
|
||||
args{
|
||||
"",
|
||||
},
|
||||
false,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := isEndsWith37(tt.args.s); got != tt.want {
|
||||
t.Errorf("isEndsWith37() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user