this repo has no description
0
fork

Configure Feed

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

pkg/encoding/json: add tests for issue 3932

Issue #3932

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I4897cd71b4959a760ebb02eb5447259af6ba59e9
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1215527
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>

+14 -2
+14 -2
pkg/encoding/json/testdata/gen.txtar
··· 20 20 schema: {x!: int} 21 21 } 22 22 23 + issue3932: { 24 + f: json.Validate({name!: string}) 25 + f: json.Marshal({name: "foo"}) 26 + } 27 + 23 28 valid: [string]: { 24 29 string // input 25 30 #result: json.Valid(string) ··· 96 101 ./in.cue:9:27 97 102 json.Validate:1:6 98 103 unmarshal.trailingInvalid.#result: error in call to encoding/json.Unmarshal: json: invalid JSON: 99 - ./in.cue:42:11 104 + ./in.cue:47:11 100 105 unmarshal.trailingValid.#result: error in call to encoding/json.Unmarshal: json: invalid JSON: 101 - ./in.cue:42:11 106 + ./in.cue:47:11 102 107 103 108 Result: 104 109 import "encoding/json" ··· 145 150 } 146 151 result: json.Validate(str, schema) 147 152 } 153 + } 154 + issue3932: { 155 + f: json.Validate({ 156 + name!: string 157 + }) & json.Marshal({ 158 + name: "foo" 159 + }) 148 160 } 149 161 valid: { 150 162 t1: {