@@ -46,16 +46,20 @@ TEST_F(ErrorDisplayTest, RenderStatus) {
46
46
std::string result =
47
47
Render ({DiagnosticDetail{loc2, eSeverityError, " X" , " X" },
48
48
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" ));
50
54
}
51
55
{
52
56
// 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 };
54
58
SourceLocation loc2 = {FileSpec{" a.c" }, 1 , 20 , 0 , false , true };
55
59
std::string result =
56
60
Render ({DiagnosticDetail{loc2, eSeverityError, " X" , " X" },
57
61
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" ));
59
63
}
60
64
{
61
65
// Test that range diagnostics are emitted correctly.
0 commit comments