[clang] 6bcd8d4 - clang-format: [JS] test declared fields.
Martin Probst via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 11 07:36:16 PST 2019
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
More information about the cfe-commits
mailing list