From b43d5b95a07e8e6400d76354f213855711d18659 Mon Sep 17 00:00:00 2001 From: Roger Peppe Date: Thu, 12 Sep 2024 14:35:22 +0100 Subject: [PATCH] cmd/cue: add test for issue 3446 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Change-Id: Ie200a6472714e94d308cb1dd172ce69b114f18ba Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1201110 Unity-Result: CUE porcuepine Reviewed-by: Daniel Martí TryBot-Result: CUEcueckoo --- cmd/cue/cmd/testdata/script/def_jsonschema.txtar | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/cue/cmd/testdata/script/def_jsonschema.txtar b/cmd/cue/cmd/testdata/script/def_jsonschema.txtar index f68cc3b97..5aad49aa5 100644 --- a/cmd/cue/cmd/testdata/script/def_jsonschema.txtar +++ b/cmd/cue/cmd/testdata/script/def_jsonschema.txtar @@ -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