pkg: -test shouldn't require a list of paths

Changes the test command to check if args contains a single path and
wraps it in a list. Now a test thread can be started without providing
a list:

  -test %/tests/lib

And passing a list still works:

  test %/tests/lib ~

One nit in this change is the lark expression to reach into args: if
args is ~ then instead of getting a useful need/have error, the test
ends in a "false-start". Perhaps this could be fixed by detecting ~
and setting it to %/tests.
This commit is contained in:
David Farrell 2022-05-27 14:43:52 -04:00
parent 5b773723b3
commit 09fdc43e6b

View File

@ -109,6 +109,10 @@
=/ m (strand ,vase)
^- form:m
=/ paz=(list path)
:: promote path to ~[path] if needed
::
?@ +<.q.arg
[(tail !<([~ path] arg)) ~]
(tail !<([~ (list path)] arg))
=/ bez=(list beam)
(turn paz |=(p=path ~|([%test-not-beam p] (need (de-beam p)))))