diff options
-rw-r--r-- | src/bufio/scan_test.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/bufio/scan_test.go b/src/bufio/scan_test.go index bf888dafb..eea87cbf7 100644 --- a/src/bufio/scan_test.go +++ b/src/bufio/scan_test.go @@ -467,15 +467,12 @@ func TestDontLoopForever(t *testing.T) { s := NewScanner(strings.NewReader("abc")) s.Split(loopAtEOFSplit) // Expect a panic - panicked := true defer func() { err := recover() if err == nil { t.Fatal("should have panicked") } - if msg, ok := err.(string); ok && strings.Contains(msg, "empty tokens") { - panicked = true - } else { + if msg, ok := err.(string); !ok || !strings.Contains(msg, "empty tokens") { panic(err) } }() |