mirror of
https://github.com/cubixle/codekata-golang.git
synced 2026-04-24 21:24:46 +01:00
40 lines
516 B
Go
40 lines
516 B
Go
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)
|
|
}
|
|
})
|
|
}
|
|
}
|