41: pandigital prime

This commit is contained in:
VicRen
2020-11-12 09:35:04 +08:00
parent 2158141f6f
commit 06e400091c
2 changed files with 86 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
package main
import "testing"
func Test_isPandigital(t *testing.T) {
type args struct {
s string
}
tests := []struct {
name string
args args
want bool
}{
{
"912345678",
args{"912345678"},
true,
},
{
"12345678",
args{"12345678"},
true,
},
{
"812349756",
args{"812349756"},
true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := isPandigital(tt.args.s); got != tt.want {
t.Errorf("isPandigital() = %v, want %v", got, tt.want)
}
})
}
}