Files
codekata-golang/20210104/main_test.go
2021-01-03 20:30:49 +08:00

58 lines
677 B
Go

package main
import "testing"
func Test_solution(t *testing.T) {
type args struct {
s string
}
tests := []struct {
name string
args args
want string
}{
{
"test1",
args{
"aaaabbbbcccc",
},
"abccbaabccba",
},
{
"test2",
args{
"rat",
},
"art",
},
{
"test3",
args{
"leetcode",
},
"cdelotee",
},
{
"test4",
args{
"ggggggg",
},
"ggggggg",
},
{
"test5",
args{
"spo",
},
"ops",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := solution(tt.args.s); got != tt.want {
t.Errorf("solution() = %v, want %v", got, tt.want)
}
})
}
}