summaryrefslogtreecommitdiff
path: root/unittests/Format/SortImportsTestJS.cpp
diff options
context:
space:
mode:
authorMartin Probst <martin@probst.io>2017-08-01 15:54:43 +0000
committerMartin Probst <martin@probst.io>2017-08-01 15:54:43 +0000
commite751234b0ab532101e4b73fa8bccf6aec0dd35a0 (patch)
treeab4220422baf6abf05fcbeb3bf742a8ce28a4436 /unittests/Format/SortImportsTestJS.cpp
parente09d41e3a104a34fc3a840f51bd619e1ab1ddff4 (diff)
clang-format: [JS] support default imports.
Summary: Formerly, `import {default as X} from y;` would not be recognized as an import. Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D36132 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309697 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/SortImportsTestJS.cpp')
-rw-r--r--unittests/Format/SortImportsTestJS.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/unittests/Format/SortImportsTestJS.cpp b/unittests/Format/SortImportsTestJS.cpp
index 4208b29702..91be0313cf 100644
--- a/unittests/Format/SortImportsTestJS.cpp
+++ b/unittests/Format/SortImportsTestJS.cpp
@@ -300,6 +300,14 @@ TEST_F(SortImportsTestJS, SortMultiLine) {
"1;");
}
+TEST_F(SortImportsTestJS, SortDefaultImports) {
+ // Reproduces issue where multi-line import was not parsed correctly.
+ verifySort("import {A} from 'a';\n"
+ "import {default as B} from 'b';\n",
+ "import {default as B} from 'b';\n"
+ "import {A} from 'a';\n");
+}
+
} // end namespace
} // end namespace format
} // end namespace clang