Commit 6bcd8d4a authored by Martin Probst's avatar Martin Probst
Browse files

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
parent a7638d38
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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