internal/cuetxtar: emit @test(err,...) annotation for error fields in eq fill
When CUE_UPDATE=1 fills an @test(pass) or
@test(eq) body and a struct field evaluates to
an error, the emitted expression now includes a
@test(err, code=..., contains="...", pos=[])
annotation on that field. This removes the need
to hand-annotate error fields after fill: the
error code and message are populated immediately;
pos=[] is left as a placeholder that a second
CUE_UPDATE=1 pass fills in automatically.
Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I17edcee89291efb906d57f5799c67e47137c61e1
Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1235393
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>