From 6e6632e9739364e6daecba9efd6491a5766743f2 Mon Sep 17 00:00:00 2001 From: Antoine Gourlay Date: Sun, 21 Dec 2014 15:56:54 +0100 Subject: 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. --- .../scala/tools/nsc/doc/html/HtmlDocletTest.scala | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/junit/scala/tools/nsc/doc/html/HtmlDocletTest.scala (limited to 'test') 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) + } +} -- cgit v1.2.3