internal/cuetxtar: add args= and suberr= to @test(err, ...)
Add two new sub-options to the err
directive:
args=[v1, v2, ...]
Checks that the error's Msg() args
include all listed strings.
Order-independent subset check:
extra actual args are allowed.
Useful for verifying type names in
conflict errors regardless of arg
order across implementations.
suberr=(...)
Matches one sub-error in a
multi-error value (e.g. failed
disjunction). Multiple suberr=
entries match order-independently.
Two-pass: pos= specs matched first,
then remaining by contains=.
pos=[] triggers write-back on
CUE_UPDATE=1.
Add TestCheckMsgArgs to inline_test.go
covering subset semantics, order-
independence, extra-args allowed,
and missing-arg failure.
Update 010_lists.txtar and
issue3330.txtar with args= and
suberr= annotations.
Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I12efa90534c0f01ad879e7b56809bb2e2ea87f65
Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1234940
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>