Skip to content

Commit

Permalink
chore: Move CliSuite to be run in tests and add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Dec 16, 2022
1 parent 78d8150 commit a1dde47
Showing 1 changed file with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package tests.cli
import java.nio.file.Files
import scala.meta.io.AbsolutePath
import java.nio.file.Paths
import tests.markdown.Compat

class CliSuite extends BaseCliSuite {

Expand All @@ -25,6 +26,43 @@ class CliSuite extends BaseCliSuite {
""".stripMargin
)

if (!Compat.isScala212)
checkCli(
"fansi-error",
s"""
|/index.md
|```scala mdoc
|val a : "\u001b[2m" = ""
|```
""".stripMargin,
"".stripMargin,
expectedExitCode = 1,
onStdout = { out =>
if (Compat.isScala3)
assertNoDiff(
out,
"""|info: Compiling 1 file to <output>
|error: index.md:2:18:
|Found: ("" : String)
|Required: ("/u001b[2m" : String)
|val a : "" = ""
| ^^
|""".stripMargin
)
else
assertNoDiff(
out,
"""|info: Compiling 1 file to <output>
|error: index.md:2:18: type mismatch;
| found : String("")
| required: "/u001B[2m"
|val a : "" = ""
| ^^
|""".stripMargin
)
}
)

checkCli(
"classpath",
"""
Expand Down

0 comments on commit a1dde47

Please sign in to comment.