Skip to content

Commit

Permalink
test for unicode escapes for quotes in interpolations
Browse files Browse the repository at this point in the history
  • Loading branch information
Martijn Hoekstra committed Sep 3, 2019
1 parent 250383c commit 36a5aee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions test/files/run/t3220-213.check
@@ -1,7 +1,7 @@
t3220-213.scala:9: warning: Unicode escapes in triple quoted strings are deprecated, use the literal character instead
def inTripleQuoted = """\u000A"""
^
t3220-213.scala:42: warning: Unicode escapes in triple quoted strings are deprecated, use the literal character instead
t3220-213.scala:43: warning: Unicode escapes in triple quoted strings are deprecated, use the literal character instead
"tab unicode escape in triple quoted string" -> """tab\u0009tab""",
^
t3220-213.scala:10: warning: Unicode escapes in raw interpolations are deprecated as of scala 2.13.1, and will be removed in scala 2.14. Use the literal character instead.
Expand All @@ -10,10 +10,10 @@ t3220-213.scala:10: warning: Unicode escapes in raw interpolations are deprecate
t3220-213.scala:11: warning: Unicode escapes in raw interpolations are deprecated as of scala 2.13.1, and will be removed in scala 2.14. Use the literal character instead.
def inTripleQuotedInterpolation = raw"""\u000A"""
^
t3220-213.scala:43: warning: Unicode escapes in raw interpolations are deprecated as of scala 2.13.1, and will be removed in scala 2.14. Use the literal character instead.
t3220-213.scala:44: warning: Unicode escapes in raw interpolations are deprecated as of scala 2.13.1, and will be removed in scala 2.14. Use the literal character instead.
"tab unicode escape in single quoted raw interpolator" -> raw"tab\u0009tab",
^
t3220-213.scala:44: warning: Unicode escapes in raw interpolations are deprecated as of scala 2.13.1, and will be removed in scala 2.14. Use the literal character instead.
t3220-213.scala:45: warning: Unicode escapes in raw interpolations are deprecated as of scala 2.13.1, and will be removed in scala 2.14. Use the literal character instead.
"tab unicode escape in triple quoted raw interpolator" -> raw"""tab\u0009tab"""
^
supported
Expand Down Expand Up @@ -49,3 +49,4 @@ List(\, \, u, 0, 0, 4, 0)
List(\, u, 0, 0, 4, 0)
List(", (, [, ^, ", \, x, 0, 0, -, \, x, 1, F, \, x, 7, F, \, \, ], |, \, \, [, \, \, ', ", b, f, n, r, t, ], |, \, \, u, [, a, -, f, A, -, F, 0, -, 9, ], {, 4, }, ), *, ")
List(b, a, d, \)
List(", _, ")
3 changes: 2 additions & 1 deletion test/files/run/t3220-213.scala
Expand Up @@ -20,6 +20,7 @@ object Literals {
def after2slashess = s"\\u0040"
def firstFailure = ("\""+"""([^"\x00-\x1F\x7F\\]|\\[\\'"bfnrt]|\\u[a-fA-F0-9]{4})*"""+"\"")
def badString = """bad\"""
def escapedQuotesInInterpolation = s"\u0022_\u0022"


def supported = List(
Expand Down Expand Up @@ -87,6 +88,6 @@ object Test {
println(Literals.after2slashess.toList)
println(Literals.firstFailure.toList)
println(Literals.badString.toList)

println(Literals.escapedQuotesInInterpolation.toList)
}
}

0 comments on commit 36a5aee

Please sign in to comment.