Skip to content

Commit

Permalink
cmd/cue: add test for issue 3446
Browse files Browse the repository at this point in the history
This adds a test that the default jsonschema strictness mode
is used even when an explicit file type has not been added.
This is not the case currently, but will be fixed in a subsequent CL.

For #3446.

Signed-off-by: Roger Peppe <[email protected]>
Change-Id: Ie200a6472714e94d308cb1dd172ce69b114f18ba
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1201110
Unity-Result: CUE porcuepine <[email protected]>
Reviewed-by: Daniel Martí <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
  • Loading branch information
rogpeppe committed Sep 12, 2024
1 parent dcfca1b commit b43d5b9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/cue/cmd/testdata/script/def_jsonschema.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ cmp stdout expect-stdout
! exec cue def jsonschema: bad.json
cmp stderr expect-stderr-strict-features

# The default strictness modes should apply even when
# we haven't explicitly specifed the jsonschema file type.
# TODO this succeeds unexpectedly right now (issue 3446).
exec cue def bad.json

exec cue def jsonschema+strictFeatures=0: bad.json

! exec cue def jsonschema: bad.json --strict
Expand Down

0 comments on commit b43d5b9

Please sign in to comment.