mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 10:54:49 +01:00
Fix sorted output flakiness by using stable_sort (#2301)
Visible with bazel test //toolchain/parser/testdata:if/fail_errors.carbon.test --runs_per_test=20 (produces 2 errors on the same line)
This commit is contained in:
@@ -37,6 +37,7 @@ TEST(SortedDiagnosticEmitterTest, SortErrors) {
|
||||
emitter.Emit({"f", 1, 3}, TestDiagnostic, "M3");
|
||||
emitter.Emit({"f", 3, 4}, TestDiagnostic, "M4");
|
||||
emitter.Emit({"f", 3, 2}, TestDiagnostic, "M5");
|
||||
emitter.Emit({"f", 3, 2}, TestDiagnostic, "M6");
|
||||
|
||||
InSequence s;
|
||||
EXPECT_CALL(consumer, HandleDiagnostic(
|
||||
@@ -51,6 +52,9 @@ TEST(SortedDiagnosticEmitterTest, SortErrors) {
|
||||
EXPECT_CALL(consumer, HandleDiagnostic(
|
||||
IsDiagnostic(DiagnosticKind::TestDiagnostic,
|
||||
DiagnosticLevel::Error, 3, 2, "M5")));
|
||||
EXPECT_CALL(consumer, HandleDiagnostic(
|
||||
IsDiagnostic(DiagnosticKind::TestDiagnostic,
|
||||
DiagnosticLevel::Error, 3, 2, "M6")));
|
||||
EXPECT_CALL(consumer, HandleDiagnostic(
|
||||
IsDiagnostic(DiagnosticKind::TestDiagnostic,
|
||||
DiagnosticLevel::Error, 3, 4, "M4")));
|
||||
|
||||
Reference in New Issue
Block a user