clang-format: [JS] Support Closure's module statements.
These are like import statements and should not be line-wrapped. Minor
restructuring of the handling of other import statements.
llvm-svn: 222637
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 6ee150c..b0733bd 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -158,6 +158,17 @@
"}); // goog.scope");
}
+TEST_F(FormatTestJS, GoogModules) {
+ verifyFormat("goog.module('this.is.really.absurdly.long');",
+ getGoogleJSStyleWithColumns(40));
+ verifyFormat("goog.require('this.is.really.absurdly.long');",
+ getGoogleJSStyleWithColumns(40));
+ verifyFormat("goog.provide('this.is.really.absurdly.long');",
+ getGoogleJSStyleWithColumns(40));
+ verifyFormat("var long = goog.require('this.is.really.absurdly.long');",
+ getGoogleJSStyleWithColumns(40));
+}
+
TEST_F(FormatTestJS, FormatsFreestandingFunctions) {
verifyFormat("function outer1(a, b) {\n"
" function inner1(a, b) { return a; }\n"