@@ -48,18 +48,22 @@ class FormatTestJS : public testing::Test {
48
48
static void verifyFormat (
49
49
StringRef Code,
50
50
const FormatStyle &Style = getGoogleStyle(FormatStyle::LK_JavaScript)) {
51
- EXPECT_EQ (Code.str (), format (Code, Style)) << " Expected code is not stable" ;
52
- std::string Result = format (test::messUp (Code), Style);
53
- EXPECT_EQ (Code.str (), Result) << " Formatted:\n " << Result;
51
+ auto Result = format (test::messUp (Code), Style);
52
+ EXPECT_EQ (Code, Result) << " Formatted:\n " << Result;
53
+ if (Code != Result)
54
+ return ;
55
+ EXPECT_EQ (Code, format (Code, Style)) << " Expected code is not stable" ;
54
56
}
55
57
56
58
static void verifyFormat (
57
59
StringRef Expected, StringRef Code,
58
60
const FormatStyle &Style = getGoogleStyle(FormatStyle::LK_JavaScript)) {
59
- EXPECT_EQ (Expected.str (), format (Expected, Style))
61
+ auto Result = format (Code, Style);
62
+ EXPECT_EQ (Expected, Result) << " Formatted:\n " << Result;
63
+ if (Expected != Result)
64
+ return ;
65
+ EXPECT_EQ (Expected, format (Expected, Style))
60
66
<< " Expected code is not stable" ;
61
- std::string Result = format (Code, Style);
62
- EXPECT_EQ (Expected.str (), Result) << " Formatted:\n " << Result;
63
67
}
64
68
};
65
69
0 commit comments