clang-format: [JS] Make Closure module detection more narrow.
Before:
var MyLongClassName = goog.module.get('my.long.module.name.followedBy.MyLongClassName');
After:
var MyLongClassName =
goog.module.get('my.long.module.name.followedBy.MyLongClassName');
llvm-svn: 222888
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index b0733bd..3e781c9 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -167,6 +167,11 @@
getGoogleJSStyleWithColumns(40));
verifyFormat("var long = goog.require('this.is.really.absurdly.long');",
getGoogleJSStyleWithColumns(40));
+
+ // These should be wrapped normally.
+ verifyFormat(
+ "var MyLongClassName =\n"
+ " goog.module.get('my.long.module.name.followedBy.MyLongClassName');");
}
TEST_F(FormatTestJS, FormatsFreestandingFunctions) {