mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 06:23:17 -10:00
script_test.go's sandbox sets DEVVM_MESSAGES=names and DATA, VMS, RUN and CFG by default, and adds stub_reset, catg (the one file a glob matches), vm_name VAR NAME (the folder's VM) and project NAME [git]; script_cmds.txtar checks each. Every script is rewritten onto them, its assertions kept; TestCommandLines leaves the scripts' own commands out. mise run test runs scripts/test.sh: the tests as before, with the CLI tests' devvm built with -cover for every package (CLI_GOCOVERDIR), merged with the Go tests' counters by go tool covdata, then scripts/coverage.sh holds each package to testdata/coverage/<os>.txt. mise run coverage raises the baselines; coverage.txtar checks the comparison. The macOS baseline is recorded from this tree. Co-Authored-By: Claude Opus 5.5 <[email protected]>
41 lines
1.2 KiB
Plaintext
41 lines
1.2 KiB
Plaintext
# devvm _msg prints a message's text.
|
|
# Not in names mode, until it's checked below.
|
|
env DEVVM_MESSAGES=
|
|
exec devvm _msg msg_unknown name=x
|
|
stdout '^There''s no message x\.$'
|
|
! stderr .
|
|
|
|
# Values are kept as given, spaces and = included.
|
|
exec devvm _msg msg_unknown 'name=a b=c'
|
|
stdout '^There''s no message a b=c\.$'
|
|
|
|
# Names mode doesn't change _msg's text.
|
|
env DEVVM_MESSAGES=names
|
|
exec devvm _msg msg_unknown name=x
|
|
stdout '^There''s no message x\.$'
|
|
|
|
# Its errors are messages too: an unknown message, a missing, unexpected or
|
|
# repeated value, an argument that isn't name=value.
|
|
! exec devvm _msg nope
|
|
stderr '^devvm: msg_unknown name=nope$'
|
|
! stdout .
|
|
! exec devvm _msg msg_unknown
|
|
stderr 'msg_missing_value key=name name=msg_unknown$'
|
|
! exec devvm _msg msg_unknown name=x vm=y
|
|
stderr 'msg_unexpected_value key=vm name=msg_unknown$'
|
|
! exec devvm _msg msg_unknown name=x name=y
|
|
stderr 'msg_repeated_value key=name$'
|
|
! exec devvm _msg msg_unknown x
|
|
stderr 'msg_not_pair arg=x$'
|
|
! exec devvm _msg
|
|
stderr '^devvm: arg_missing args=NAME \[key=value\.\.\.\] command=devvm _msg$'
|
|
|
|
# Without names mode, errors are the text.
|
|
env DEVVM_MESSAGES=
|
|
! exec devvm _msg nope
|
|
stderr '^devvm: There''s no message nope\.$'
|
|
|
|
# _msg isn't in the help.
|
|
exec devvm --help
|
|
! stdout _msg
|