pkg/encoding: add tests that Unmarshal rejects trailing input
json correctly rejects trailing input whether it is valid or invalid,
like encoding/json.Unmarshal does, but yaml does not yet,
as already pointed out in the TODO I added to internal/encoding/yaml.
The following CL will fix the yaml package to do the right thing.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I01b381259ca0251bdb6e46dab60ca943226fe793
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1193241
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>