summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
authorMartin Probst <martin@probst.io>2019-11-07 23:37:06 +0100
committerMartin Probst <martin@probst.io>2019-11-11 16:36:00 +0100
commit6bcd8d4a18fc0604a2297a626c1fc808cbfb7b9b (patch)
tree3f8378895cef62b4ff1f6450f80dd741c767ecb7 /clang/unittests/Format/FormatTestJS.cpp
parenta7638d384983e8e3eb44a2d8c757238efc7096dc (diff)
downloadbcm5719-llvm-6bcd8d4a18fc0604a2297a626c1fc808cbfb7b9b.tar.gz
bcm5719-llvm-6bcd8d4a18fc0604a2297a626c1fc808cbfb7b9b.zip
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
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 30a0b37ef69..619a19f1a22 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
OpenPOWER on IntegriCloud