Author: Martin Probst
Date: 2019-11-11T16:36:00+01:00
New Revision: 6bcd8d4a18fc0604a2297a626c1fc808cbfb7b9b

URL: 
https://github.com/llvm/llvm-project/commit/6bcd8d4a18fc0604a2297a626c1fc808cbfb7b9b
DIFF: 
https://github.com/llvm/llvm-project/commit/6bcd8d4a18fc0604a2297a626c1fc808cbfb7b9b.diff

LOG: clang-format: [JS] test declared fields.

Summary:
TypeScript now supports declaring fields:

    class Foo {
      declare field: string;
    }

clang-format happens to already format this fine, so this change just
adds a regression test.

Reviewers: krasimir

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69972

Added: 
    

Modified: 
    clang/unittests/Format/FormatTestJS.cpp

Removed: 
    


################################################################################
diff  --git a/clang/unittests/Format/FormatTestJS.cpp 
b/clang/unittests/Format/FormatTestJS.cpp
index 30a0b37ef69b..619a19f1a22d 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -2369,5 +2369,12 @@ TEST_F(FormatTestJS, SupportPrivateFieldsAndMethods) {
                "  static #staticPrivateMethod() {}\n");
 }
 
+TEST_F(FormatTestJS, DeclaredFields) {
+  verifyFormat("class Example {\n"
+               "  declare pub: string;\n"
+               "  declare private priv: string;\n"
+               "}\n");
+}
+
 } // namespace format
 } // end namespace clang


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to