23cb8ea7e9
- 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
30 lines
720 B
Go
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"))
|
|
}
|