diff options
author | Antoine Gourlay <antoine@gourlay.fr> | 2014-12-21 15:56:54 +0100 |
---|---|---|
committer | Antoine Gourlay <antoine@gourlay.fr> | 2015-03-26 19:06:23 +0100 |
commit | 6e6632e9739364e6daecba9efd6491a5766743f2 (patch) | |
tree | e01c7eef012a4de24870726e7e5b669567cf4b65 /test/junit | |
parent | 2dc40cc7d7d956a510a9278ab236014f3fb564bc (diff) | |
download | scala-6e6632e9739364e6daecba9efd6491a5766743f2.tar.gz scala-6e6632e9739364e6daecba9efd6491a5766743f2.tar.bz2 scala-6e6632e9739364e6daecba9efd6491a5766743f2.zip |
SI-9038 fix scaladoc syntax highlightning to leave unicode alone
Syntax highlightning in code blocks used to manipulate the raw bytes of
a String, converting them to chars when needed, which breaks Unicode
surrogate pairs.
Using a char array instead of a byte array will leave them alone.
Diffstat (limited to 'test/junit')
-rw-r--r-- | test/junit/scala/tools/nsc/doc/html/HtmlDocletTest.scala | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/junit/scala/tools/nsc/doc/html/HtmlDocletTest.scala b/test/junit/scala/tools/nsc/doc/html/HtmlDocletTest.scala new file mode 100644 index 0000000000..13a955b55d --- /dev/null +++ b/test/junit/scala/tools/nsc/doc/html/HtmlDocletTest.scala @@ -0,0 +1,22 @@ +package scala.tools.nsc.doc.html + +import org.junit.Test +import org.junit.Assert._ +import org.junit.runner.RunWith +import org.junit.runners.JUnit4 + +import scala.tools.testing.AssertUtil._ + +@RunWith(classOf[JUnit4]) +class HtmlDocletTest { + @Test + def testSyntaxHighlightningUnicode() { + val in = "unicode: …" + + val out = SyntaxHigh(in).toString + + // SI-9038, this failed with + // "unicode: …" != "unicode: ¬タᆭ" + assertEquals(in, out) + } +} |