Skip to content

Commit 0c95a88

Browse files
Ararsa-Deresevyas-git
authored andcommitted
suite.Passed: add one more status test report (stretchr#1706)
## Summary This test case verifies that the Passed method returns false when all tests in the suite fail ## Changes Added a test case to check the scenario where all tests fail. ## Motivation This test is important to ensure that the Passed method correctly identifies the overall failure state of a test suite when none of the individual tests pass. ## Example usage This test can be used as a part of the test suite to validate the behavior of the Passed method under failure conditions. ## Related issues None
1 parent 67d4eb2 commit 0c95a88

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

suite/stats_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,14 @@ func TestPassedReturnsFalseWhenSomeTestFails(t *testing.T) {
2727

2828
assert.False(t, sinfo.Passed())
2929
}
30+
31+
func TestPassedReturnsFalseWhenAllTestsFail(t *testing.T) {
32+
sinfo := newSuiteInformation()
33+
sinfo.TestStats = map[string]*TestInformation{
34+
"Test1": {TestName: "Test1", Passed: false},
35+
"Test2": {TestName: "Test2", Passed: false},
36+
"Test3": {TestName: "Test3", Passed: false},
37+
}
38+
39+
assert.False(t, sinfo.Passed())
40+
}

0 commit comments

Comments
 (0)