From 8a0e3b3d7cb2c4efeffe5610aa1146a85f0ffa10 Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Wed, 11 Sep 2024 16:07:03 -0700 Subject: [PATCH] Add a regression test for handling of `///` comments https://github.com/google/google-java-format/issues/1153 PiperOrigin-RevId: 673574143 --- .../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 3e4e175e6..d0817a2cf 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 000000000..e2b27dde1 --- /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 000000000..e2b27dde1 --- /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; + } +}