Skip to content

Commit

Permalink
Add a test suite to ensure sbt does not exit eagerly
Browse files Browse the repository at this point in the history
  • Loading branch information
daddykotex authored and tgodzik committed Sep 27, 2022
1 parent cb5f5e1 commit 3817567
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mdoc-sbt/src/sbt-test/sbt-mdoc/extra-arguments/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ThisBuild / scalaVersion := "2.13.9"

enablePlugins(MdocPlugin)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version = 1.7.1
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"))
22 changes: 22 additions & 0 deletions mdoc-sbt/src/sbt-test/sbt-mdoc/extra-arguments/test
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
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
```
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.
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
```

0 comments on commit 3817567

Please sign in to comment.