summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestSelective.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2016-03-17 13:03:41 +0000
committerDaniel Jasper <djasper@google.com>2016-03-17 13:03:41 +0000
commit97439926e4ae88db7f603814e4abafefcfcc26d5 (patch)
treebe642c41453ab54734ca7ac6acfd83ad95401ed7 /clang/unittests/Format/FormatTestSelective.cpp
parenta8e9cb38aeef17365236b34c90b1324817d70f62 (diff)
downloadbcm5719-llvm-97439926e4ae88db7f603814e4abafefcfcc26d5.tar.gz
bcm5719-llvm-97439926e4ae88db7f603814e4abafefcfcc26d5.zip
clang-format: [JS] Make requoting of JavaScript string literals only
change affected ranges. llvm-svn: 263713
Diffstat (limited to 'clang/unittests/Format/FormatTestSelective.cpp')
-rw-r--r--clang/unittests/Format/FormatTestSelective.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestSelective.cpp b/clang/unittests/Format/FormatTestSelective.cpp
index 5885cadee62..c4286d4297d 100644
--- a/clang/unittests/Format/FormatTestSelective.cpp
+++ b/clang/unittests/Format/FormatTestSelective.cpp
@@ -512,6 +512,18 @@ TEST_F(FormatTestSelective, StopFormattingWhenLeavingScope) {
15, 0));
}
+TEST_F(FormatTestSelective, SelectivelyRequoteJavaScript) {
+ Style = getGoogleStyle(FormatStyle::LK_JavaScript);
+ EXPECT_EQ(
+ "var x = \"a\";\n"
+ "var x = 'a';\n"
+ "var x = \"a\";",
+ format("var x = \"a\";\n"
+ "var x = \"a\";\n"
+ "var x = \"a\";",
+ 20, 0));
+}
+
} // end namespace
} // end namespace format
} // end namespace clang
OpenPOWER on IntegriCloud