@@ -46,16 +46,20 @@ TEST_F(ErrorDisplayTest, RenderStatus) {
4646 std::string result =
4747 Render ({DiagnosticDetail{loc2, eSeverityError, " X" , " X" },
4848 DiagnosticDetail{loc1, eSeverityError, " Y" , " Y" }});
49- ASSERT_LT (StringRef (result).find (" Y" ), StringRef (result).find (" X" ));
49+ // Unintuitively the later diagnostic appears first in the string:
50+ // ^ ^
51+ // | second
52+ // first
53+ ASSERT_GT (StringRef (result).find (" Y" ), StringRef (result).find (" X" ));
5054 }
5155 {
5256 // Test that diagnostics in reverse order are emitted correctly.
53- SourceLocation loc1 = {FileSpec{" a.c" }, 2 , 10 , 0 , false , true };
57+ SourceLocation loc1 = {FileSpec{" a.c" }, 1 , 10 , 0 , false , true };
5458 SourceLocation loc2 = {FileSpec{" a.c" }, 1 , 20 , 0 , false , true };
5559 std::string result =
5660 Render ({DiagnosticDetail{loc2, eSeverityError, " X" , " X" },
5761 DiagnosticDetail{loc1, eSeverityError, " Y" , " Y" }});
58- ASSERT_LT (StringRef (result).find (" Y" ), StringRef (result).find (" X" ));
62+ ASSERT_GT (StringRef (result).find (" Y" ), StringRef (result).find (" X" ));
5963 }
6064 {
6165 // Test that range diagnostics are emitted correctly.
0 commit comments