Skip to content

Commit

Permalink
Avoid having to espace \" in test classes
Browse files Browse the repository at this point in the history
Signed-off-by: Pavlo Shevchenko <pshevchenko@gradle.com>
  • Loading branch information
pshevche committed Feb 27, 2023
1 parent cb8599a commit df2e94a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ abstract class AbstractPluginFuncTest extends Specification {
}

String markerFileExistsCheck(String id = "id") {
"Files.exists(Paths.get(\"build/marker.file.${StringEscapeUtils.escapeJava(id)}\"))"
"""Files.exists(Paths.get("build/marker.file.${StringEscapeUtils.escapeJava(id)}"))"""
}

String flakyAssertClass() {
Expand Down Expand Up @@ -147,11 +147,11 @@ abstract class AbstractPluginFuncTest extends Specification {
}

static String flakyAssert(String id = "id", int failures = 1) {
return "acme.FlakyAssert.flakyAssert(\"${StringEscapeUtils.escapeJava(id)}\", $failures);"
return """acme.FlakyAssert.flakyAssert("${StringEscapeUtils.escapeJava(id)}", $failures);"""
}

static String flakyAssertPassFailPass(String id = "id") {
return "acme.FlakyAssert.flakyAssertPassFailPass(\"${StringEscapeUtils.escapeJava(id)}\");"
return """acme.FlakyAssert.flakyAssertPassFailPass("${StringEscapeUtils.escapeJava(id)}");"""
}

@SuppressWarnings("GroovyAssignabilityCheck")
Expand Down

0 comments on commit df2e94a

Please sign in to comment.