diff options
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index 8a9ac9e20b8..c0215e7d142 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -31,19 +31,19 @@ protected: 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, UnderstandsJavaScriptOperators) { 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) { |