scalalandio / chimney

Scala library for boilerplate-free, type-safe data transformations
https://chimney.readthedocs.io
Apache License 2.0
1.15k stars 91 forks source link

Test more Scala CLI snippets for output (printed results) #536

Closed MateuszKubuszok closed 2 months ago

MateuszKubuszok commented 3 months ago

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:

  1. run sbt publish-local-for-tests to publish artifacts locally
  2. 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
  3. then open some .md file, look fora a snippet without output/error test
  4. add
    // expected output:
    // make it fail
  5. rerun scala-cli run scripts/test-snippets.scala -- ... to verify that it fails
  6. modify example to make it pass
  7. go to 3. and repeat