8000 Do not rely on `Formatter` in the debug prints of `RegexEngineTest`. · scala-js/scala-js@eae9211 · GitHub
[go: up one dir, main page]

Skip to content

Commit eae9211

Browse files
committed
Do not rely on Formatter in the debug prints of RegexEngineTest.
`Formatter` is an entire beast of its own. It is a poor fit for the debugging output of another area of the test suite.
1 parent dd3330a commit eae9211

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/util/regex/RegexEngineTest.scala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ class RegexEngineTest {
5454

5555
private def debugEscape(pattern: String): String = {
5656
pattern.flatMap {
57-
case '\t' => "`t"
58-
case '\n' => "`n"
59-
case '\r' => "`r"
60-
case c if c < ' ' => "`x%02X".format(c.toInt)
61-
case c => c.toString()
57+
case '\t' => "`t"
58+
case '\n' => "`n"
59+
case '\r' => "`r"
60+
case c if c < 0x10 => "`x0" + c.toInt.toHexString
61+
case c if c < ' ' => "`x" + c.toInt.toHexString
62+
case c => c.toString()
6263
}
6364
}
6465

0 commit comments

Comments
 (0)
0