unison/unison-src/transcripts/test-command.md
2024-06-26 12:02:55 -07:00

900 B

Merge builtins so we get enough names for the testing stuff.

scratch/main> builtins.merge

The test command should run all of the tests in the current directory.

test1 : [Result]
test1 = [Ok "test1"]

foo.test2 : [Result]
foo.test2 = [Ok "test2"]
scratch/main> add
scratch/main> test

Tests should be cached if unchanged.

scratch/main> test

test won't descend into the lib namespace, but test.all will.

lib.dep.testInLib : [Result]
lib.dep.testInLib = [Ok "testInLib"]
scratch/main> add
scratch/main> test
scratch/main> test.all

test WILL run tests within lib if specified explicitly.

scratch/main> test lib.dep

test can be given a relative path, in which case it will only run tests found somewhere in that namespace.

scratch/main> test foo