26 Star 102 Fork 24

codeskyblue / gohttpserver

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
utils_test.go 543 Bytes
一键复制 编辑 原始数据 按行查看 历史
codeskyblue 提交于 2016-07-30 09:31 . fix tests
package main
import "testing"
func TestSublimeContains(t *testing.T) {
tests := []struct {
text string
substr string
pass bool
}{
{"hello", "lo", true},
{"abcdefg", "cf", true},
{"abcdefg", "a", true},
{"abcdefg", "b", true},
{"abcdefg", "cfa", false},
{"abcdefg", "aa", false},
{"世界", "a", false},
{"Hello 世界", "界", true},
{"Hello 世界", "elo", true},
}
for _, v := range tests {
res := SublimeContains(v.text, v.substr)
if res != v.pass {
t.Fatalf("Failed: %v - res:%v", v, res)
}
}
}
Go
1
https://gitee.com/shxsun/gohttpserver.git
git@gitee.com:shxsun/gohttpserver.git
shxsun
gohttpserver
gohttpserver
master

搜索帮助