diff options
author | Som Snytt <som.snytt@gmail.com> | 2014-07-18 22:34:01 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2014-07-18 22:34:01 -0700 |
commit | b4f506749189b337bd25633d521b6b917108ee15 (patch) | |
tree | a4cd21c3c514c1106b51d754ca16645ebd2fdcee /test/junit | |
parent | abb58dcef1b4758f4e3af26c030e1f0630b8d145 (diff) | |
download | scala-b4f506749189b337bd25633d521b6b917108ee15.tar.gz scala-b4f506749189b337bd25633d521b6b917108ee15.tar.bz2 scala-b4f506749189b337bd25633d521b6b917108ee15.zip |
SI-6476 Documentation
And adjust the test.
Diffstat (limited to 'test/junit')
-rw-r--r-- | test/junit/scala/StringContextTest.scala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/junit/scala/StringContextTest.scala b/test/junit/scala/StringContextTest.scala index 5abfe90cd1..bb0e8c4252 100644 --- a/test/junit/scala/StringContextTest.scala +++ b/test/junit/scala/StringContextTest.scala @@ -48,4 +48,18 @@ class StringContextTest { val res = processEscapes(s) assertEquals("Scala", res) } + + @Test def t6631_baseline() = assertEquals("\f\r\n\t", s"""\f\r\n\t""") + + @Test def t6631_badEscape() = assertThrows[InvalidEscapeException] { + s"""\x""" + } + + // verifying that the standard interpolators can be supplanted + @Test def antiHijack_?() = { + object AllYourStringsAreBelongToMe { case class StringContext(args: Any*) { def s(args: Any) = "!!!!" } } + import AllYourStringsAreBelongToMe._ + //assertEquals("????", s"????") + assertEquals("!!!!", s"????") // OK to hijack core interpolator ids + } } |