Skip to content

Commit

Permalink
Improve repro for b/165671890
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 423598508
  • Loading branch information
cushon authored and Error Prone Team committed Jan 23, 2022
1 parent d284923 commit 882d7c9
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -104,15 +104,17 @@ public void formatMethod() {
.doTest();
}

// "$ f" is a valid format string, because ' ' is a flag
// TODO(b/165671890): consider adding a heuristic to skip these
@Test
public void percent() {
public void spaceAfterPercent() {
testHelper
.addSourceLines(
"Test.java",
"class Test {",
" void f() {",
" StringBuilder messageBuilder = ",
" new StringBuilder(\"hakuna % matata\").append(\"y\").append(\"n\");",
" // BUG: Diagnostic contains:",
" StringBuilder messageBuilder = new StringBuilder(\"more than 50% finished\");",
" }",
"}")
.doTest();
Expand Down

0 comments on commit 882d7c9

Please sign in to comment.