This revision was automatically updated to reflect the committed changes. Closed by commit rL266744: Summary: (authored by mprobst).
Changed prior to commit: http://reviews.llvm.org/D19206?vs=54019&id=54192#toc Repository: rL LLVM http://reviews.llvm.org/D19206 Files: cfe/trunk/unittests/Format/FormatTestJS.cpp Index: cfe/trunk/unittests/Format/FormatTestJS.cpp =================================================================== --- cfe/trunk/unittests/Format/FormatTestJS.cpp +++ cfe/trunk/unittests/Format/FormatTestJS.cpp @@ -943,6 +943,16 @@ "class Y {}"); } +TEST_F(FormatTestJS, TypeAliases) { + verifyFormat("type X = number;\n" + "class C {}"); + verifyFormat("type X<Y> = Z<Y>;"); + verifyFormat("type X = {\n" + " y: number\n" + "};\n" + "class C {}"); +} + TEST_F(FormatTestJS, Modules) { verifyFormat("import SomeThing from 'some/module.js';"); verifyFormat("import {X, Y} from 'some/module.js';"); @@ -1095,7 +1105,10 @@ "var y;"); } -TEST_F(FormatTestJS, CastSyntax) { verifyFormat("var x = <type>foo;"); } +TEST_F(FormatTestJS, CastSyntax) { + verifyFormat("var x = <type>foo;"); + verifyFormat("var x = foo as type;"); +} TEST_F(FormatTestJS, TypeArguments) { verifyFormat("class X<Y> {}");
Index: cfe/trunk/unittests/Format/FormatTestJS.cpp =================================================================== --- cfe/trunk/unittests/Format/FormatTestJS.cpp +++ cfe/trunk/unittests/Format/FormatTestJS.cpp @@ -943,6 +943,16 @@ "class Y {}"); } +TEST_F(FormatTestJS, TypeAliases) { + verifyFormat("type X = number;\n" + "class C {}"); + verifyFormat("type X<Y> = Z<Y>;"); + verifyFormat("type X = {\n" + " y: number\n" + "};\n" + "class C {}"); +} + TEST_F(FormatTestJS, Modules) { verifyFormat("import SomeThing from 'some/module.js';"); verifyFormat("import {X, Y} from 'some/module.js';"); @@ -1095,7 +1105,10 @@ "var y;"); } -TEST_F(FormatTestJS, CastSyntax) { verifyFormat("var x = <type>foo;"); } +TEST_F(FormatTestJS, CastSyntax) { + verifyFormat("var x = <type>foo;"); + verifyFormat("var x = foo as type;"); +} TEST_F(FormatTestJS, TypeArguments) { verifyFormat("class X<Y> {}");
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits