Skip to content

Commit 7a0008c

Browse files
demangle: in TestCases count failures and differences separately
1 parent 94bb783 commit 7a0008c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

cases_test.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30086,7 +30086,8 @@ var casesExceptions = map[string]string{
3008630086

3008730087
func TestCases(t *testing.T) {
3008830088
t.Parallel()
30089-
expectedFails := 0
30089+
expectedErrors := 0
30090+
expectedDifferent := 0
3009030091
found := make(map[string]bool)
3009130092
for _, test := range cases {
3009230093
expectedFail := casesExpectedFailures[test[0]]
@@ -30102,7 +30103,7 @@ func TestCases(t *testing.T) {
3010230103
if expectedFail || (haveException && exception == "") {
3010330104
t.Logf("demangling %s: expected failure: error %v", test[0], err)
3010430105
if expectedFail {
30105-
expectedFails++
30106+
expectedErrors++
3010630107
found[test[0]] = true
3010730108
}
3010830109
} else {
@@ -30111,7 +30112,7 @@ func TestCases(t *testing.T) {
3011130112
} else if got != want && !closeEnoughCase(got, want) {
3011230113
if expectedFail {
3011330114
t.Logf("demangling %s: expected failure: got %s, want %s", test[0], got, want)
30114-
expectedFails++
30115+
expectedDifferent++
3011530116
found[test[0]] = true
3011630117
} else if haveException && exception == "" {
3011730118
t.Errorf("demangling %s: expected to fail, but succeeded with %s", test[0], got)
@@ -30137,8 +30138,11 @@ func TestCases(t *testing.T) {
3013730138
}
3013830139
}
3013930140
}
30140-
if expectedFails > 0 {
30141-
t.Logf("%d expected failures out of %d cases", expectedFails, len(cases))
30141+
if expectedDifferent > 0 {
30142+
t.Logf("%d different demanglings out of %d cases", expectedDifferent, len(cases))
30143+
}
30144+
if expectedErrors > 0 {
30145+
t.Logf("%d expected failures out of %d cases", expectedErrors, len(cases))
3014230146
}
3014330147
}
3014430148

0 commit comments

Comments
 (0)