diff options
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index 63bcfdc1744..845ae5124b2 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -795,15 +795,11 @@ TEST_F(FormatTestJS, TemplateStrings) { " ${ name }\n" " !`;")); - // FIXME: +1 / -1 offsets are to work around clang-format miscalculating - // widths for unknown tokens that are not whitespace (e.g. '`'). Remove when - // the code is corrected. - verifyFormat("var x =\n" " `hello ${world}` >= some();", getGoogleJSStyleWithColumns(34)); // Barely doesn't fit. verifyFormat("var x = `hello ${world}` >= some();", - getGoogleJSStyleWithColumns(35 + 1)); // Barely fits. + getGoogleJSStyleWithColumns(35)); // Barely fits. EXPECT_EQ("var x = `hello\n" " ${world}` >=\n" " some();", @@ -818,10 +814,14 @@ TEST_F(FormatTestJS, TemplateStrings) { " ${world}` >= some();", getGoogleJSStyleWithColumns(22))); // Barely fits. - verifyFormat("var x =\n `h`;", getGoogleJSStyleWithColumns(13 - 1)); + verifyFormat("var x =\n" + " `h`;", + getGoogleJSStyleWithColumns(11)); EXPECT_EQ( "var x =\n `multi\n line`;", - format("var x = `multi\n line`;", getGoogleJSStyleWithColumns(14 - 1))); + format("var x = `multi\n line`;", getGoogleJSStyleWithColumns(13))); + verifyFormat("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(\n" + " `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`);"); // Make sure template strings get a proper ColumnWidth assigned, even if they // are first token in line. |