This commit is contained in:
VicRen
2020-12-11 10:19:38 +08:00
parent c5deee203f
commit e5fca8a7a9
2 changed files with 86 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
package main
import "testing"
func Test_process(t *testing.T) {
type args struct {
k int
s string
}
tests := []struct {
name string
args args
want string
}{
{
"test1",
args{
2,
"abcdefg",
},
"bacdfeg",
},
{
"test2",
args{
4,
"abcdefg",
},
"dcbaefg",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := process(tt.args.k, tt.args.s); got != tt.want {
t.Errorf("process() = %v, want %v", got, tt.want)
}
})
}
}