mirror of
https://github.com/cubixle/codekata-golang.git
synced 2026-04-30 15:48:41 +01:00
20201222
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
package main
|
||||
|
||||
import "testing"
|
||||
|
||||
func Test_isCompatible(t *testing.T) {
|
||||
type args struct {
|
||||
a string
|
||||
b string
|
||||
c string
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
want bool
|
||||
}{
|
||||
{
|
||||
"test1",
|
||||
args{
|
||||
"aabcc",
|
||||
"dbbca",
|
||||
"aadbbcbcac",
|
||||
},
|
||||
true,
|
||||
},
|
||||
{
|
||||
"test2",
|
||||
args{
|
||||
"aabcc",
|
||||
"dbbca",
|
||||
"aadbbbaccc",
|
||||
},
|
||||
false,
|
||||
},
|
||||
{
|
||||
"test3",
|
||||
args{
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
},
|
||||
true,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := isCompatible(tt.args.a, tt.args.b, tt.args.c); got != tt.want {
|
||||
t.Errorf("isCompatible() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user