From de08ce739a76f92b201b17a0d0da1143522f6111 Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Wed, 11 Sep 2024 15:09:15 -0700 Subject: [PATCH] Add a regression test for handling of `///` comments https://github.com/google/google-java-format/issues/1153 PiperOrigin-RevId: 673553329 --- .../java/FormatterIntegrationTest.java | 2 ++ .../googlejavaformat/java/testdata/I1153.input | 15 +++++++++++++++ .../googlejavaformat/java/testdata/I1153.output | 15 +++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 core/src/test/resources/com/google/googlejavaformat/java/testdata/I1153.input create mode 100644 core/src/test/resources/com/google/googlejavaformat/java/testdata/I1153.output diff --git a/core/src/test/java/com/google/googlejavaformat/java/FormatterIntegrationTest.java b/core/src/test/java/com/google/googlejavaformat/java/FormatterIntegrationTest.java index 3e4e175e..d0817a2c 100644 --- a/core/src/test/java/com/google/googlejavaformat/java/FormatterIntegrationTest.java +++ b/core/src/test/java/com/google/googlejavaformat/java/FormatterIntegrationTest.java @@ -72,6 +72,8 @@ public class FormatterIntegrationTest { "I981", "I1020", "I1037") + // TODO: https://github.com/google/google-java-format/issues/1153 + // .putAll(23, "I1153") .build(); @Parameters(name = "{index}: {0}") diff --git a/core/src/test/resources/com/google/googlejavaformat/java/testdata/I1153.input b/core/src/test/resources/com/google/googlejavaformat/java/testdata/I1153.input new file mode 100644 index 00000000..e2b27dde --- /dev/null +++ b/core/src/test/resources/com/google/googlejavaformat/java/testdata/I1153.input @@ -0,0 +1,15 @@ +class I1153 { + void f() { + //// (1) one + int one; + + //// (2) two + int two; + + //// (2.1) if we need to collect data using multiple different collectors, e.g. taxonomy and + //// ranges, or even two taxonomy facets that use different Category List Field, we can + //// use MultiCollectorManager, e.g.: + // TODO: This should be (2.1) two point one + int twoPointOne; + } +} diff --git a/core/src/test/resources/com/google/googlejavaformat/java/testdata/I1153.output b/core/src/test/resources/com/google/googlejavaformat/java/testdata/I1153.output new file mode 100644 index 00000000..e2b27dde --- /dev/null +++ b/core/src/test/resources/com/google/googlejavaformat/java/testdata/I1153.output @@ -0,0 +1,15 @@ +class I1153 { + void f() { + //// (1) one + int one; + + //// (2) two + int two; + + //// (2.1) if we need to collect data using multiple different collectors, e.g. taxonomy and + //// ranges, or even two taxonomy facets that use different Category List Field, we can + //// use MultiCollectorManager, e.g.: + // TODO: This should be (2.1) two point one + int twoPointOne; + } +}