encoding/jsonschema: add test cases for nested values
The current `state.value` logic looks wrong: it sets the `allowedTypes`
value recursively when it encounters a structured value such
as an array or an object even though only the top level
of the value should influence the allowed types.
As it happens, the fact that `usedTypes` is set at the same
time hides this error, and it _seems_ that no other
test fails as a result. However, upcoming changes will reveal
this shortcoming, so we add a couple of test cases to
show the fix.
Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I85173a321d3578094fc96f5b56ed6269c496c18c
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1199399
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>