Explorar o código

lib/sync: Cleanly fail instead of panic in tests (#6088)

Simon Frei %!s(int64=6) %!d(string=hai) anos
pai
achega
1a06ab68eb
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      lib/sync/sync_test.go

+ 1 - 2
lib/sync/sync_test.go

@@ -152,8 +152,7 @@ func TestRWMutex(t *testing.T) {
 
 	if len(messages) != 2 {
 		t.Errorf("Unexpected message count")
-	}
-	if !strings.Contains(messages[1], "RUnlockers while locking:\nat sync") || !strings.Contains(messages[1], "sync_test.go:") {
+	} else if !strings.Contains(messages[1], "RUnlockers while locking:\nat sync") || !strings.Contains(messages[1], "sync_test.go:") {
 		t.Error("Unexpected message")
 	}