Update aosp/master clang for rebase to r233350
Change-Id: I12d4823f10bc9e445b8b86e7721b71f98d1df442
diff --git a/unittests/Format/FormatTestJS.cpp b/unittests/Format/FormatTestJS.cpp
index 55e89da..5707024 100644
--- a/unittests/Format/FormatTestJS.cpp
+++ b/unittests/Format/FormatTestJS.cpp
@@ -94,10 +94,7 @@
TEST_F(FormatTestJS, ES6DestructuringAssignment) {
verifyFormat("var [a, b, c] = [1, 2, 3];");
- verifyFormat("var {a, b} = {\n"
- " a: 1,\n"
- " b: 2\n"
- "};");
+ verifyFormat("var {a, b} = {a: 1, b: 2};");
}
TEST_F(FormatTestJS, ContainerLiterals) {
@@ -139,6 +136,12 @@
" return x.zIsTooLongForOneLineWithTheDeclarationLine();\n"
" }\n"
"};");
+ // Simple object literal, as opposed to enum style below.
+ verifyFormat("var obj = {a: 123};");
+ // Enum style top level assignment.
+ verifyFormat("X = {\n a: 123\n};");
+ verifyFormat("X.Y = {\n a: 123\n};");
+ verifyFormat("x = foo && {a: 123};");
}
TEST_F(FormatTestJS, SpacesInContainerLiterals) {
@@ -545,7 +548,7 @@
getGoogleJSStyleWithColumns(20));
verifyFormat("import {X as myLocalX, Y as myLocalY} from 'some/module.js';");
verifyFormat("import * as lib from 'some/module.js';");
- verifyFormat("var x = {\n import: 1\n};\nx.import = 2;");
+ verifyFormat("var x = {import: 1};\nx.import = 2;");
verifyFormat("export function fn() {\n"
" return 'fn';\n"
@@ -613,5 +616,17 @@
verifyFormat("var x = `hello` == `hello`;");
}
+TEST_F(FormatTestJS, CastSyntax) {
+ verifyFormat("var x = <type>foo;");
+}
+
+TEST_F(FormatTestJS, TypeArguments) {
+ verifyFormat("class X<Y> {}");
+ verifyFormat("new X<Y>();");
+ verifyFormat("foo<Y>(a);");
+ verifyFormat("var x: X<Y>[];");
+ verifyFormat("class C extends D<E> implements F<G>, H<I> {}");
+}
+
} // end namespace tooling
} // end namespace clang