2022-07-11 18:23:31 +03:00
|
|
|
Merge builtins so we get enough names for the testing stuff.
|
|
|
|
|
|
|
|
The `test` command should run all of the tests in the current directory.
|
|
|
|
|
2024-07-10 17:46:18 +03:00
|
|
|
``` unison
|
2022-07-11 18:23:31 +03:00
|
|
|
test1 : [Result]
|
|
|
|
test1 = [Ok "test1"]
|
2024-05-14 23:54:53 +03:00
|
|
|
|
|
|
|
foo.test2 : [Result]
|
|
|
|
foo.test2 = [Ok "test2"]
|
2022-07-11 18:23:31 +03:00
|
|
|
```
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2022-07-11 18:23:31 +03:00
|
|
|
|
2023-12-22 14:55:24 +03:00
|
|
|
Loading changes detected in scratch.u.
|
|
|
|
|
2022-07-11 18:23:31 +03:00
|
|
|
I found and typechecked these definitions in scratch.u. If you
|
|
|
|
do an `add` or `update`, here's how your codebase would
|
|
|
|
change:
|
|
|
|
|
|
|
|
⍟ These new definitions are ok to `add`:
|
|
|
|
|
2024-05-14 23:54:53 +03:00
|
|
|
foo.test2 : [Result]
|
|
|
|
test1 : [Result]
|
2022-07-11 18:23:31 +03:00
|
|
|
|
|
|
|
```
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> test
|
2022-07-11 18:23:31 +03:00
|
|
|
|
|
|
|
✅
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-14 23:54:53 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-11 18:23:31 +03:00
|
|
|
New test results:
|
|
|
|
|
2024-06-27 08:14:37 +03:00
|
|
|
1. foo.test2 ◉ test2
|
|
|
|
2. test1 ◉ test1
|
2022-07-11 18:23:31 +03:00
|
|
|
|
2024-05-14 23:54:53 +03:00
|
|
|
✅ 2 test(s) passing
|
2022-07-11 18:23:31 +03:00
|
|
|
|
2024-06-26 23:01:36 +03:00
|
|
|
Tip: Use view 1 to view the source of a test.
|
2022-07-11 18:23:31 +03:00
|
|
|
|
2023-12-13 23:36:34 +03:00
|
|
|
```
|
|
|
|
Tests should be cached if unchanged.
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> test
|
2023-12-13 23:36:34 +03:00
|
|
|
|
|
|
|
Cached test results (`help testcache` to learn more)
|
|
|
|
|
2024-06-27 08:14:37 +03:00
|
|
|
1. foo.test2 ◉ test2
|
|
|
|
2. test1 ◉ test1
|
2023-12-13 23:36:34 +03:00
|
|
|
|
2024-05-14 23:54:53 +03:00
|
|
|
✅ 2 test(s) passing
|
2023-12-13 23:36:34 +03:00
|
|
|
|
2024-06-26 23:01:36 +03:00
|
|
|
Tip: Use view 1 to view the source of a test.
|
2023-12-13 23:36:34 +03:00
|
|
|
|
2022-07-11 18:23:31 +03:00
|
|
|
```
|
|
|
|
`test` won't descend into the `lib` namespace, but `test.all` will.
|
|
|
|
|
2024-07-10 17:46:18 +03:00
|
|
|
``` unison
|
2024-06-26 22:00:40 +03:00
|
|
|
lib.dep.testInLib : [Result]
|
|
|
|
lib.dep.testInLib = [Ok "testInLib"]
|
2022-07-11 18:23:31 +03:00
|
|
|
```
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2022-07-11 18:23:31 +03:00
|
|
|
|
2023-12-22 14:55:24 +03:00
|
|
|
Loading changes detected in scratch.u.
|
|
|
|
|
2022-07-11 18:23:31 +03:00
|
|
|
I found and typechecked these definitions in scratch.u. If you
|
|
|
|
do an `add` or `update`, here's how your codebase would
|
|
|
|
change:
|
|
|
|
|
|
|
|
⍟ These new definitions are ok to `add`:
|
|
|
|
|
2024-06-26 22:00:40 +03:00
|
|
|
lib.dep.testInLib : [Result]
|
2022-07-11 18:23:31 +03:00
|
|
|
|
|
|
|
```
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> test
|
2022-07-11 18:23:31 +03:00
|
|
|
|
|
|
|
Cached test results (`help testcache` to learn more)
|
|
|
|
|
2024-06-27 08:14:37 +03:00
|
|
|
1. foo.test2 ◉ test2
|
|
|
|
2. test1 ◉ test1
|
2022-07-11 18:23:31 +03:00
|
|
|
|
2024-05-14 23:54:53 +03:00
|
|
|
✅ 2 test(s) passing
|
2022-07-11 18:23:31 +03:00
|
|
|
|
2024-06-26 23:01:36 +03:00
|
|
|
Tip: Use view 1 to view the source of a test.
|
2022-07-11 18:23:31 +03:00
|
|
|
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> test.all
|
2022-07-11 18:23:31 +03:00
|
|
|
|
|
|
|
|
|
|
|
Cached test results (`help testcache` to learn more)
|
|
|
|
|
2024-06-27 08:14:37 +03:00
|
|
|
1. foo.test2 ◉ test2
|
|
|
|
2. test1 ◉ test1
|
2022-07-11 18:23:31 +03:00
|
|
|
|
2024-05-14 23:54:53 +03:00
|
|
|
✅ 2 test(s) passing
|
2022-07-11 18:23:31 +03:00
|
|
|
|
|
|
|
✅
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
New test results:
|
|
|
|
|
2024-06-27 20:51:18 +03:00
|
|
|
1. lib.dep.testInLib ◉ testInLib
|
2022-07-11 18:23:31 +03:00
|
|
|
|
|
|
|
✅ 1 test(s) passing
|
|
|
|
|
2024-06-26 23:01:36 +03:00
|
|
|
Tip: Use view 1 to view the source of a test.
|
2022-07-11 18:23:31 +03:00
|
|
|
|
|
|
|
```
|
2024-06-26 22:31:10 +03:00
|
|
|
`test` WILL run tests within `lib` if specified explicitly.
|
2022-07-12 03:51:40 +03:00
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-26 22:00:40 +03:00
|
|
|
scratch/main> test lib.dep
|
2022-07-12 03:51:40 +03:00
|
|
|
|
2023-12-13 23:22:11 +03:00
|
|
|
Cached test results (`help testcache` to learn more)
|
2022-07-12 03:51:40 +03:00
|
|
|
|
2024-06-27 20:51:18 +03:00
|
|
|
1. lib.dep.testInLib ◉ testInLib
|
2022-07-12 03:51:40 +03:00
|
|
|
|
2023-12-13 23:22:11 +03:00
|
|
|
✅ 1 test(s) passing
|
2022-07-12 03:51:40 +03:00
|
|
|
|
2024-06-26 23:01:36 +03:00
|
|
|
Tip: Use view 1 to view the source of a test.
|
2022-07-12 03:51:40 +03:00
|
|
|
|
|
|
|
```
|
2024-05-14 23:54:53 +03:00
|
|
|
`test` can be given a relative path, in which case it will only run tests found somewhere in that namespace.
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> test foo
|
2024-05-14 23:54:53 +03:00
|
|
|
|
|
|
|
Cached test results (`help testcache` to learn more)
|
|
|
|
|
2024-06-27 08:14:37 +03:00
|
|
|
1. foo.test2 ◉ test2
|
2024-05-14 23:54:53 +03:00
|
|
|
|
|
|
|
✅ 1 test(s) passing
|
|
|
|
|
2024-06-26 23:01:36 +03:00
|
|
|
Tip: Use view 1 to view the source of a test.
|
2024-05-14 23:54:53 +03:00
|
|
|
|
|
|
|
```
|