clang-format: Let chromium style inherit google style's javascript tweaks.
llvm-svn: 200652
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 8a9ac9e..c0215e7 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -31,19 +31,19 @@
return Result;
}
- static std::string format(llvm::StringRef Code,
- const FormatStyle &Style = getGoogleJSStyle()) {
+ static std::string format(llvm::StringRef Code, const FormatStyle &Style) {
return format(Code, 0, Code.size(), Style);
}
static FormatStyle getGoogleJSStyleWithColumns(unsigned ColumnLimit) {
- FormatStyle Style = getGoogleJSStyle();
+ FormatStyle Style = getGoogleStyle(FormatStyle::LK_JavaScript);
Style.ColumnLimit = ColumnLimit;
return Style;
}
- static void verifyFormat(llvm::StringRef Code,
- const FormatStyle &Style = getGoogleJSStyle()) {
+ static void verifyFormat(
+ llvm::StringRef Code,
+ const FormatStyle &Style = getGoogleStyle(FormatStyle::LK_JavaScript)) {
EXPECT_EQ(Code.str(), format(test::messUp(Code), Style));
}
};
@@ -82,6 +82,9 @@
TEST_F(FormatTestJS, SpacesInContainerLiterals) {
verifyFormat("var arr = [1, 2, 3];");
verifyFormat("var obj = {a: 1, b: 2, c: 3};");
+
+ verifyFormat("var obj = {a: 1, b: 2, c: 3};",
+ getChromiumStyle(FormatStyle::LK_JavaScript));
}
TEST_F(FormatTestJS, SingleQuoteStrings) {