-
Notifications
You must be signed in to change notification settings - Fork 346
Open
Labels
Description
What version of CUE are you using (cue version)?
af0cfc15a
Does this issue reproduce with the latest stable release?
Yes
What did you do?
exec cue export -t field=value x1.cue
cmp stdout want-stdout
exec cue export -t field=value x2.cue
cmp stdout want-stdout
-- x1.cue --
field: string @tag(field)
other: field
-- x2.cue --
field!: string @tag(field)
other: field
-- want-stdout --
{
"field": "value",
"other": "value"
}
What did you expect to see?
A passing test. Describing the tagged field as required seems appropriate,
as the configuration does indeed require the field to be filled in by the CUE command's
injection, and a "field is required but not present" error is arguably and earlier
and more obvious failure than an "incomplete value" error.
What did you see instead?
> exec cue export -t field=value x1.cue
[stdout]
{
"field": "value",
"other": "value"
}
> cmp stdout want-stdout
> exec cue export -t field=value x2.cue
[stderr]
no tag for "field"
@tag not allowed within field constraint:
./x2.cue:1:16
[exit status 1]
FAIL: /tmp/x.txtar:4: unexpected command failure
As an aside, the error message is not very obvious either: I didn't immediately realise that it's referring to a field constraint as distinct from a field itself.
Reactions are currently unavailable