diff options
| author | chrislu <chris.lu@gmail.com> | 2022-07-24 19:13:54 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-07-24 19:13:54 -0700 |
| commit | 33cff6199219f4f8cb099fd95fdc8612cb32f562 (patch) | |
| tree | eb23712f2a601c2c0941ab1c6f4a1379601c855d | |
| parent | dbe4849ffd42b770b108e94c565ba9341e07ee03 (diff) | |
| download | seaweedfs-33cff6199219f4f8cb099fd95fdc8612cb32f562.tar.xz seaweedfs-33cff6199219f4f8cb099fd95fdc8612cb32f562.zip | |
fix glog test
| -rw-r--r-- | weed/glog/glog_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/glog/glog_test.go b/weed/glog/glog_test.go index 12c3acf3d..4a667259b 100644 --- a/weed/glog/glog_test.go +++ b/weed/glog/glog_test.go @@ -125,9 +125,9 @@ func TestInfoDepth(t *testing.T) { // pull out the line number (between : and ]) msg := m[strings.LastIndex(m, ":")+1:] - x := strings.Index(msg, "]") + x := strings.Index(msg, " ") if x < 0 { - t.Errorf("InfoDepth[%d]: missing ']': %q", i, m) + t.Errorf("InfoDepth[%d]: missing ' ': %q", i, m) continue } line, err := strconv.Atoi(msg[:x]) @@ -180,7 +180,7 @@ func TestHeader(t *testing.T) { pid = 1234 Info("test") var line int - format := "I0102 15:04:05 1234 glog_test.go:%d] test\n" + format := "I0102 15:04:05.067890 glog_test.go:%d test\n" n, err := fmt.Sscanf(contents(infoLog), format, &line) if n != 1 || err != nil { t.Errorf("log format error: %d elements, error %s:\n%s", n, err, contents(infoLog)) |
