summaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Format/FormatTestJS.cpp')
-rw-r--r--unittests/Format/FormatTestJS.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/unittests/Format/FormatTestJS.cpp b/unittests/Format/FormatTestJS.cpp
index 59f4a4f6dcfe..230717fe47cc 100644
--- a/unittests/Format/FormatTestJS.cpp
+++ b/unittests/Format/FormatTestJS.cpp
@@ -858,6 +858,26 @@ TEST_F(FormatTestJS, AutomaticSemicolonInsertionHeuristic) {
"return 1",
"a = null\n"
" return 1");
+ verifyFormat(
+ "x = {\n"
+ " a: 1\n"
+ "}\n"
+ "class Y {}",
+ " x = {a : 1}\n"
+ " class Y { }");
+}
+
+TEST_F(FormatTestJS, ImportExportASI) {
+ verifyFormat(
+ "import {x} from 'y'\n"
+ "export function z() {}",
+ "import {x} from 'y'\n"
+ " export function z() {}");
+ verifyFormat(
+ "export {x}\n"
+ "class Y {}",
+ " export {x}\n"
+ " class Y {\n}");
}
TEST_F(FormatTestJS, ClosureStyleCasts) {