diff options
author | Daniel Jasper <djasper@google.com> | 2016-03-17 13:03:41 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2016-03-17 13:03:41 +0000 |
commit | 97439926e4ae88db7f603814e4abafefcfcc26d5 (patch) | |
tree | be642c41453ab54734ca7ac6acfd83ad95401ed7 /clang/unittests/Format/FormatTestSelective.cpp | |
parent | a8e9cb38aeef17365236b34c90b1324817d70f62 (diff) | |
download | bcm5719-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.cpp | 12 |
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 |