|
16 | 16 |
|
17 | 17 | import static com.google.common.truth.Truth.assertThat; |
18 | 18 | import static com.google.common.truth.Truth.assertWithMessage; |
19 | | -import static com.google.common.truth.TruthJUnit.assume; |
20 | 19 | import static java.nio.charset.StandardCharsets.UTF_8; |
21 | 20 | import static org.junit.Assert.assertThrows; |
22 | 21 |
|
23 | | -import com.google.common.base.Enums; |
24 | 22 | import com.google.common.io.CharStreams; |
25 | 23 | import com.google.googlejavaformat.java.JavaFormatterOptions.Style; |
26 | 24 | import java.io.ByteArrayInputStream; |
|
31 | 29 | import java.io.StringWriter; |
32 | 30 | import java.nio.file.Files; |
33 | 31 | import java.nio.file.Path; |
34 | | -import javax.lang.model.element.Modifier; |
35 | 32 | import org.junit.Rule; |
36 | 33 | import org.junit.Test; |
37 | 34 | import org.junit.rules.TemporaryFolder; |
@@ -872,38 +869,4 @@ public void maxLineLengthOutOfRange() { |
872 | 869 |
|
873 | 870 | assertThat(Style.builder().maxLineLength(999).build().maxLineLength()).isEqualTo(999); |
874 | 871 | } |
875 | | - |
876 | | - @Test |
877 | | - public void valueClassAndRecord() throws Exception { |
878 | | - assume().that(Enums.getIfPresent(Modifier.class, "VALUE").isPresent()).isTrue(); |
879 | | - String input = |
880 | | - """ |
881 | | - value final public class PointValueClass { |
882 | | - final int x; |
883 | | - final int y; |
884 | | -
|
885 | | - PointValueClass(int x, int y) { |
886 | | - this.x = x; |
887 | | - this.y = y; |
888 | | - } |
889 | | - } |
890 | | -
|
891 | | - value public record PointValueRecord(int x, int y) {} |
892 | | - """; |
893 | | - String expected = |
894 | | - """ |
895 | | - public final value class PointValueClass { |
896 | | - final int x; |
897 | | - final int y; |
898 | | -
|
899 | | - PointValueClass(int x, int y) { |
900 | | - this.x = x; |
901 | | - this.y = y; |
902 | | - } |
903 | | - } |
904 | | -
|
905 | | - public value record PointValueRecord(int x, int y) {} |
906 | | - """; |
907 | | - assertThat(new Formatter().formatSource(input)).isEqualTo(expected); |
908 | | - } |
909 | 872 | } |
0 commit comments