-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test suite to ensure
sbt
does not exit eagerly
- Loading branch information
1 parent
cb5f5e1
commit 3817567
Showing
7 changed files
with
43 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ThisBuild / scalaVersion := "2.13.9" | ||
|
||
enablePlugins(MdocPlugin) |
1 change: 1 addition & 0 deletions
1
mdoc-sbt/src/sbt-test/sbt-mdoc/extra-arguments/project/build.properties
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 @@ | ||
sbt.version = 1.7.1 |
2 changes: 2 additions & 0 deletions
2
mdoc-sbt/src/sbt-test/sbt-mdoc/extra-arguments/project/plugins.sbt
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,2 @@ | ||
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.9.0") | ||
addSbtPlugin("org.scalameta" % "sbt-mdoc" % sys.props("plugin.version")) |
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,22 @@ | ||
# valid | ||
$ copy-file test-docs/valid.md docs/readme.md | ||
> mdoc | ||
|
||
# --check tests | ||
## file has not changed to `--check` is expected to succeed | ||
> set mdocExtraArguments := Seq("--check") | ||
> mdoc | ||
## replace the content | ||
$ copy-file test-docs/valid-check.md docs/readme.md | ||
-> mdoc | ||
|
||
|
||
# --check-link-hygiene | ||
## file is valid so mdoc is expected to succeed | ||
> set mdocExtraArguments := Seq("--check-link-hygiene") | ||
## replace the content with a markdown with broken links | ||
$ copy-file test-docs/invalid.md docs/readme.md | ||
-> mdoc | ||
|
||
> set mdocExtraArguments := Seq.empty | ||
> mdoc # no error, just warnings |
7 changes: 7 additions & 0 deletions
7
mdoc-sbt/src/sbt-test/sbt-mdoc/extra-arguments/test-docs/invalid.md
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,7 @@ | ||
# Invalid | ||
|
||
This file contains an invalid link. See [Invalid](#valid). | ||
|
||
```scala mdoc | ||
1 + 1 | ||
``` |
1 change: 1 addition & 0 deletions
1
mdoc-sbt/src/sbt-test/sbt-mdoc/extra-arguments/test-docs/valid-check.md
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 @@ | ||
This file is also valid, it's used to check the `--check` flag. |
7 changes: 7 additions & 0 deletions
7
mdoc-sbt/src/sbt-test/sbt-mdoc/extra-arguments/test-docs/valid.md
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,7 @@ | ||
# Valid | ||
|
||
This file is valid, with no link error. See [Valid](#valid). | ||
|
||
```scala mdoc | ||
1 + 1 | ||
``` |