mysqlbinlog/binlog_test.go

26 lines
495 B
Go
Raw Normal View History

2023-04-25 18:41:34 +08:00
package binlog
import (
"testing"
)
func TestNextBinlogPath(t *testing.T) {
a, err := NextBinlogPath("/opt/mysql-relay-log.000199")
if nil != err {
t.Errorf("got err %v", err)
}
if "/opt/mysql-relay-log.000200" != a {
t.Errorf("got wrong return %v", a)
}
}
func TestNextBinlogName(t *testing.T) {
a, err := NextBinlogName("/opt/mysql-relay-log.000199")
if nil != err {
t.Errorf("got err %v", err)
}
if "mysql-relay-log.000200" != a {
t.Errorf("got wrong return %v", a)
}
}