-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously, it was possible to assert that a code fence does not compile but it was not possible to assert that a code fence compiles with a warning. Now, it's possible to use the new `mdoc:warn` modifier to assert that a program compiles successfully but with warnings.
- Loading branch information
Showing
12 changed files
with
123 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package tests.markdown | ||
|
||
class WarnSuite extends BaseMarkdownSuite { | ||
|
||
check( | ||
"warn", | ||
""" | ||
|```scala mdoc:warn | ||
|List(1) match { case Nil => } | ||
|``` | ||
""".stripMargin, | ||
"""|```scala | ||
|List(1) match { case Nil => } | ||
|// warning: match may not be exhaustive. | ||
|// It would fail on the following input: List(_) | ||
|// List(1) match { case Nil => } | ||
|// ^^^^^^^ | ||
|``` | ||
|""".stripMargin | ||
) | ||
|
||
checkError( | ||
"error", | ||
""" | ||
|```scala mdoc:warn | ||
|val x: Int = "" | ||
|``` | ||
""".stripMargin, | ||
"""|error: error.md:3:1: Expected compile warnings but program failed to compile | ||
|val x: Int = "" | ||
|^^^^^^^^^^^^^^^ | ||
|""".stripMargin | ||
) | ||
|
||
checkError( | ||
"success", | ||
""" | ||
|```scala mdoc:warn | ||
|val x: Int = 42 | ||
|``` | ||
""".stripMargin, | ||
"""|error: success.md:3:1: Expected compile warnings but program compiled successfully without warnings | ||
|val x: Int = 42 | ||
|^^^^^^^^^^^^^^^ | ||
|""".stripMargin | ||
) | ||
} |