File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -38,8 +38,8 @@ class LogWithNewline {
38
38
raw_ostream &os)
39
39
: os(os) {
40
40
if (debug_type)
41
- os << debug_type << " " ;
42
- os << " [ " << file << " :" << line << " ] " ;
41
+ os << " [ " << debug_type << " ] " ;
42
+ os << file << " :" << line << " " ;
43
43
}
44
44
~LogWithNewline () { os << ' \n ' ; }
45
45
template <typename T> raw_ostream &operator <<(const T &t) && {
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ TEST(DebugLogTest, Basic) {
27
27
std::string str;
28
28
raw_string_ostream os (str);
29
29
DEBUGLOG_WITH_STREAM_AND_TYPE (os, nullptr ) << " NoType" ;
30
- EXPECT_TRUE (StringRef (os.str ()).starts_with (' [' ));
30
+ EXPECT_FALSE (StringRef (os.str ()).starts_with (' [' ));
31
31
EXPECT_TRUE (StringRef (os.str ()).ends_with (" NoType\n " ));
32
32
}
33
33
@@ -37,6 +37,7 @@ TEST(DebugLogTest, Basic) {
37
37
raw_string_ostream os (str);
38
38
DEBUGLOG_WITH_STREAM_AND_TYPE (os, " A" ) << " A" ;
39
39
DEBUGLOG_WITH_STREAM_AND_TYPE (os, " B" ) << " B" ;
40
+ EXPECT_TRUE (StringRef (os.str ()).starts_with (' [' ));
40
41
EXPECT_THAT (os.str (), AllOf (HasSubstr (" A\n " ), HasSubstr (" B\n " )));
41
42
}
42
43
You can’t perform that action at this time.
0 commit comments