File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
pkg/encoding/json/testdata Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ validate: enforceRequired: {
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,9 +101,9 @@ validate.t2.result: error in call to encoding/json.Validate: invalid value 10 (o
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"
@@ -146,6 +151,13 @@ validate: {
146
151
result: json.Validate(str, schema)
147
152
}
148
153
}
154
+ issue3932: {
155
+ f: json.Validate({
156
+ name!: string
157
+ }) & json.Marshal({
158
+ name: "foo"
159
+ })
160
+ }
149
161
valid: {
150
162
t1: {
151
163
"1"
You can’t perform that action at this time.
0 commit comments