Skip to content

Commit a89db5b

Browse files
committed
Spell out the expected text in theMissingSpaceRuleAppliesToEveryLineOfTheRun
As a format string the expected comment no longer read like the input it is rewritten from. The concatenation is back, with FormatStringConcatenation suppressed on the test.
1 parent 0224ad9 commit a89db5b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎open-java-format/src/test/java/com/palantir/javaformat/java/JavaCommentsHelperTest.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,14 @@ void anUnbreakableTokenIsLeftLong() throws Exception {
9696
assertThat(rewritten).contains("/// " + url);
9797
}
9898

99+
@SuppressWarnings("FormatStringConcatenation") // Written out like the input, not as a template
99100
@Test
100101
void theMissingSpaceRuleAppliesToEveryLineOfTheRun() throws Exception {
101102
// Otherwise the same source formats differently depending on whether the running JDK hands the run
102103
// over as one tok (23 and later) or as one tok per line.
103104
String rewritten = rewrite("///Summary line.\n" + " ".repeat(COLUMN) + "///More text.", Style.OJF);
104105

105-
assertThat(rewritten).isEqualTo("/// Summary line.\n%s/// More text.", " ".repeat(COLUMN));
106+
assertThat(rewritten).isEqualTo("/// Summary line.\n" + " ".repeat(COLUMN) + "/// More text.");
106107
}
107108

108109
@Test

0 commit comments

Comments
 (0)