mprobst created this revision.
mprobst added a reviewer: krasimir.
Herald added a project: clang.
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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D69972
Files:
clang/unittests/Format/FormatTestJS.cpp
Index: clang/unittests/Format/FormatTestJS.cpp
===================================================================
--- clang/unittests/Format/FormatTestJS.cpp
+++ clang/unittests/Format/FormatTestJS.cpp
@@ -2359,5 +2359,12 @@
" 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
Index: clang/unittests/Format/FormatTestJS.cpp
===================================================================
--- clang/unittests/Format/FormatTestJS.cpp
+++ clang/unittests/Format/FormatTestJS.cpp
@@ -2359,5 +2359,12 @@
" 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
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits