@@ -2,6 +2,7 @@ package dotty.tools.dotc.printing
22
33import scala .language .unsafeNulls
44
5+ import dotty .shaded .fansi
56import dotty .tools .DottyTest
67import org .junit .Assert ._
78import org .junit .{Ignore , Test }
@@ -12,14 +13,15 @@ class SyntaxHighlightingTests extends DottyTest {
1213 import SyntaxHighlighting ._
1314
1415 private def test (source : String , expected : String ): Unit = {
16+
1517 val highlighted = SyntaxHighlighting .highlight(source)(using ctx.withColors)
16- .replace(NoColor , " >" )
17- .replace(CommentColor , " <C|" )
18- .replace(KeywordColor , " <K|" )
19- .replace(ValDefColor , " <V|" )
20- .replace(LiteralColor , " <L|" )
21- .replace(StringColor , " <S|" )
22- .replace(TypeColor , " <T|" )
18+ .replace(fansi. Attrs .emitAnsiCodes(fansi. Color . Red .applyMask, NoColor .applyMask) , " >" )
19+ .replace(fansi. Attrs .emitAnsiCodes( NoColor .applyMask, CommentColor .applyMask) , " <C|" )
20+ .replace(fansi. Attrs .emitAnsiCodes( NoColor .applyMask, KeywordColor .applyMask) , " <K|" )
21+ .replace(fansi. Attrs .emitAnsiCodes( NoColor .applyMask, ValDefColor .applyMask) , " <V|" )
22+ .replace(fansi. Attrs .emitAnsiCodes( NoColor .applyMask, LiteralColor .applyMask) , " <L|" )
23+ .replace(fansi. Attrs .emitAnsiCodes( NoColor .applyMask, StringColor .applyMask) , " <S|" )
24+ .replace(fansi. Attrs .emitAnsiCodes( NoColor .applyMask, TypeColor .applyMask) , " <T|" )
2325 // .replace(AnnotationColor, "<A|") // is the same color as type color
2426
2527 if (expected != highlighted) {
0 commit comments