diff options
author | Daniel Jasper <djasper@google.com> | 2014-11-23 16:46:28 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-11-23 16:46:28 +0000 |
commit | 44c8f335d6525bba1eff5635504c01b499a6e0e5 (patch) | |
tree | 1179a05a2b5c8c3b58e4cb4f037026ede1ac2eda /unittests | |
parent | 2205147a95e614cf4a20a854078dc85af9453326 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222637 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/Format/FormatTestJS.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/unittests/Format/FormatTestJS.cpp b/unittests/Format/FormatTestJS.cpp index 6ee150c662..b0733bdd25 100644 --- a/unittests/Format/FormatTestJS.cpp +++ b/unittests/Format/FormatTestJS.cpp @@ -158,6 +158,17 @@ TEST_F(FormatTestJS, GoogScopes) { "}); // 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" |