this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

encoding/jsonschema: add test for Config.PkgName

In the recent jsonschema changes, we had lost the functionality of
adding a package name to the output. There were no tests for this, so
this CL adds a test; the functionality itself will be fixed in the next
CL.

This also updates the error output from the external tests with
respect to some recent evaluator changes.

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I775bf247a4440b3dcb745546ff1c71d62b9143b5
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1205903
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>

+35
+1
encoding/jsonschema/decode_test.go
··· 101 101 cfg.Strict = t.HasTag("strict") 102 102 cfg.StrictKeywords = cfg.StrictKeywords || t.HasTag("strictKeywords") 103 103 cfg.StrictFeatures = t.HasTag("strictFeatures") 104 + cfg.PkgName, _ = t.Value("pkgName") 104 105 105 106 ctx := t.CueContext() 106 107
+34
encoding/jsonschema/testdata/txtar/pkgname.txtar
··· 1 + #pkgName: somepkg 2 + -- schema.json -- 3 + { 4 + "$schema": "https://json-schema.org/draft/2019-09/schema", 5 + "type": "object", 6 + "title": "Main schema", 7 + "description": "Specify who you are and all.", 8 + "$defs": { 9 + "phone number": { 10 + "description": "a telephone number", 11 + "type": "string" 12 + } 13 + }, 14 + "properties": { 15 + "person": { 16 + "description": "A person is a human being.", 17 + "type": "object" 18 + } 19 + } 20 + } 21 + -- out/decode/extract -- 22 + // Main schema 23 + // 24 + // Specify who you are and all. 25 + @jsonschema(schema="https://json-schema.org/draft/2019-09/schema") 26 + 27 + // A person is a human being. 28 + person?: { 29 + ... 30 + } 31 + 32 + // a telephone number 33 + #: "phone number": string 34 + ...