[PATCH] clang-format: [JS] handle comments in template strings.

Martin Probst martinprobst at google.com
Tue Apr 14 17:02:02 PDT 2015


================
Comment at: unittests/Format/FormatTestJS.cpp:652
@@ +651,3 @@
+  // Comments in template strings.
+  verifyFormat("var x = `//a`;\n"
+               "var y");
----------------
djasper wrote:
> I'd be slightly hesitant to use verifyFormat for any of these as that simply cops out when finding "//". Thus, tests might pass for the wrong reasons. It is probably better to use EXPECT_EQ with a manually messed up "before".
Done, wasn't aware of that. clang-format would actually misformat these snippets (indenting the second var) before the change, so the tests did move from red to green during development.

http://reviews.llvm.org/D8990

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list