소스 검색

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

Simon Frei 6 년 전
부모
커밋
1a06ab68eb
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  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")
 	}