Feat: done
This commit is contained in:
21
reverse_test.go
Normal file
21
reverse_test.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package reverse
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestReverse(t *testing.T) {
|
||||
tcs := []struct {
|
||||
input string
|
||||
expects string
|
||||
}{
|
||||
{"Hello 世界", "界世 olleH"},
|
||||
}
|
||||
|
||||
for _, tc := range tcs {
|
||||
b := []byte(tc.input)
|
||||
reverse(b)
|
||||
ret := string(b)
|
||||
if ret != tc.expects {
|
||||
t.Errorf("Failed to remove unicode space. Input: %s, expects: %s, results: %s", tc.input, tc.expects, ret)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user