Currently most Scala CLI snippets in the docs are tested (with ScalaCLI.md Spec) either if they merely compile or for failures (// expected error:.
Snippets testing for successful result could println some result and have it checked with // expected output:.
This would be relatively simple to do:
run sbt publish-local-for-tests to publish artifacts locally
then scala-cli run scripts/test-snippets.scala -- --extra "chimney-version=[version from the artifacts]" --test-only '*' "$PWD/docs/docs" - it should run all tests
then open some .md file, look fora a snippet without output/error test
add
// expected output:
// make it fail
rerun scala-cli run scripts/test-snippets.scala -- ... to verify that it fails
Currently most Scala CLI snippets in the docs are tested (with ScalaCLI.md Spec) either if they merely compile or for failures (
// expected error:
.Snippets testing for successful result could
println
some result and have it checked with// expected output:
.This would be relatively simple to do:
sbt publish-local-for-tests
to publish artifacts locallyscala-cli run scripts/test-snippets.scala -- --extra "chimney-version=[version from the artifacts]" --test-only '*' "$PWD/docs/docs"
- it should run all tests.md
file, look fora a snippet without output/error testscala-cli run scripts/test-snippets.scala -- ...
to verify that it fails