unison/unison-src/transcripts/io-test-command.md

44 lines
851 B
Markdown
Raw Permalink Normal View History

``` ucm :hide
scratch/main> builtins.merge
2023-12-13 23:30:29 +03:00
```
The `io.test` command should run all of the tests within the current namespace, excluding libs.
``` unison :hide
2023-12-13 23:30:29 +03:00
-- We manually specify types so we don't need to pull in base to run IO and such
ioAndExceptionTest : '{IO, Exception} [Result]
ioAndExceptionTest = do
2023-12-13 23:30:29 +03:00
[Ok "Success"]
ioTest : '{IO} [Result]
ioTest = do
2023-12-13 23:30:29 +03:00
[Ok "Success"]
lib.ioAndExceptionTestInLib : '{IO, Exception} [Result]
lib.ioAndExceptionTestInLib = do
2023-12-13 23:30:29 +03:00
[Ok "Success"]
```
``` ucm :hide
scratch/main> add
2023-12-13 23:30:29 +03:00
```
Run a IO tests one by one
2023-12-13 23:30:29 +03:00
``` ucm
scratch/main> io.test ioAndExceptionTest
scratch/main> io.test ioTest
2023-12-13 23:30:29 +03:00
```
`io.test` doesn't cache results
``` ucm
scratch/main> io.test ioAndExceptionTest
2023-12-13 23:30:29 +03:00
```
`io.test.all` will run all matching tests except those in the `lib` namespace.
``` ucm
scratch/main> io.test.all
2023-12-13 23:30:29 +03:00
```