gh-ost/go/base/utils_test.go
Shlomi Noach 23cb8ea7e9 Throttling & critical load
- Added `--throttle-query` param (when returns > 0, throttling applies)
- Added `--critical-load`, similar to `--max-load` but implies panic and quit
- Recoded *-load as `LoadMap`
- More info on *-load throttle/panic
- `printStatus()` now gets printing heuristic. Always shows up on interactive `"status"`
- Fixed `change column` (aka rename) handling with quotes
- Removed legacy `mysqlbinlog` parser code
- Added tests
2016-06-18 21:12:07 +02:00

30 lines
720 B
Go

/*
Copyright 2016 GitHub Inc.
See https://github.com/github/gh-ost/blob/master/LICENSE
*/
package base
import (
"testing"
"github.com/outbrain/golib/log"
test "github.com/outbrain/golib/tests"
)
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"))
}