1 Star 0 Fork 0

孙立/cli

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
sort_test.go 587 Bytes
一键复制 编辑 原始数据 按行查看 历史
package cli
import "testing"
var lexicographicLessTests = []struct {
i string
j string
expected bool
}{
{"", "a", true},
{"a", "", false},
{"a", "a", false},
{"a", "A", false},
{"A", "a", true},
{"aa", "a", false},
{"a", "aa", true},
{"a", "b", true},
{"a", "B", true},
{"A", "b", true},
{"A", "B", true},
}
func TestLexicographicLess(t *testing.T) {
for _, test := range lexicographicLessTests {
actual := lexicographicLess(test.i, test.j)
if test.expected != actual {
t.Errorf(`expected string "%s" to come before "%s"`, test.i, test.j)
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/JackSun6/cli.git
git@gitee.com:JackSun6/cli.git
JackSun6
cli
cli
master

搜索帮助