diff options
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index f062cbfaf23..8c74b0425ad 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -510,5 +510,18 @@ TEST_F(FormatTestJS, ClassDeclarations) { verifyFormat("class C extends P implements I {}"); } +TEST_F(FormatTestJS, MetadataAnnotations) { + verifyFormat("@A\nclass C {\n}"); + verifyFormat("@A({arg: 'value'})\nclass C {\n}"); + verifyFormat("@A\n@B\nclass C {\n}"); + verifyFormat("class C {\n @A x: string;\n}"); + verifyFormat("class C {\n" + " @A\n" + " private x(): string {\n" + " return 'y';\n" + " }\n" + "}"); +} + } // end namespace tooling } // end namespace clang |