Browse Source

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

Simon Frei 6 years ago
parent
commit
1a06ab68eb
1 changed files with 1 additions and 2 deletions
  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")
 	}