2016-06-18 19:12:07 +00:00
|
|
|
/*
|
|
|
|
Copyright 2016 GitHub Inc.
|
|
|
|
See https://github.com/github/gh-ost/blob/master/LICENSE
|
|
|
|
*/
|
|
|
|
|
|
|
|
package base
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2021-06-24 18:19:37 +00:00
|
|
|
"github.com/openark/golib/log"
|
|
|
|
test "github.com/openark/golib/tests"
|
2016-06-18 19:12:07 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
log.SetLevel(log.ERROR)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestStringContainsAll(t *testing.T) {
|
|
|
|
s := `insert,delete,update`
|
|
|
|
|
|
|
|
test.S(t).ExpectFalse(StringContainsAll(s))
|
|
|
|
test.S(t).ExpectFalse(StringContainsAll(s, ""))
|
|
|
|
test.S(t).ExpectFalse(StringContainsAll(s, "drop"))
|
|
|
|
test.S(t).ExpectTrue(StringContainsAll(s, "insert"))
|
|
|
|
test.S(t).ExpectFalse(StringContainsAll(s, "insert", "drop"))
|
|
|
|
test.S(t).ExpectTrue(StringContainsAll(s, "insert", ""))
|
|
|
|
test.S(t).ExpectTrue(StringContainsAll(s, "insert", "update", "delete"))
|
|
|
|
}
|