unison/unison-src/transcripts/io-test-command.output.md
Greg Pfeil 0031542faf
Add a space before code block info strings
This is for consistency with the `cmark` style. Now the blocks we still
pretty-print ourselves will match the bulk of them that `cmark`
produces.
2024-07-10 13:56:07 -06:00

1.4 KiB

The io.test command should run all of the tests within the current namespace, excluding libs.

-- We manually specify types so we don't need to pull in base to run IO and such
ioAndExceptionTest : '{IO, Exception} [Result]
ioAndExceptionTest = do 
  [Ok "Success"]

ioTest : '{IO} [Result]
ioTest = do 
  [Ok "Success"]

lib.ioAndExceptionTestInLib  : '{IO, Exception} [Result]
lib.ioAndExceptionTestInLib  = do 
  [Ok "Success"]

Run a IO tests one by one

scratch/main> io.test ioAndExceptionTest

    New test results:
  
    1. ioAndExceptionTest   ◉ Success
  
  ✅ 1 test(s) passing
  
  Tip: Use view 1 to view the source of a test.

scratch/main> io.test ioTest

    New test results:
  
    1. ioTest   ◉ Success
  
  ✅ 1 test(s) passing
  
  Tip: Use view 1 to view the source of a test.

io.test doesn't cache results

scratch/main> io.test ioAndExceptionTest

    New test results:
  
    1. ioAndExceptionTest   ◉ Success
  
  ✅ 1 test(s) passing
  
  Tip: Use view 1 to view the source of a test.

io.test.all will run all matching tests except those in the lib namespace.

scratch/main> io.test.all

  

  

  

  

    New test results:
  
    1. ioAndExceptionTest   ◉ Success
    2. ioTest               ◉ Success
  
  ✅ 2 test(s) passing
  
  Tip: Use view 1 to view the source of a test.