@@ -59,6 +59,17 @@ maxItems: {
59
59
fail1: [0, 1]
60
60
}
61
61
62
+ reverse: {
63
+ [string]: {x: _, v: list.Reverse(x)}
64
+
65
+ t1: x: []
66
+ t2: x: [1]
67
+ t3: x: [1, 2, 3, 4]
68
+
69
+ fail1: x: 1
70
+ fail2: x: "bad"
71
+ }
72
+
62
73
-- out/list-v3 --
63
74
Errors:
64
75
repeat.t8.v: error in call to list.Repeat: negative count:
@@ -74,6 +85,10 @@ minItems.fail1: invalid value [] (does not satisfy list.MinItems(1)): len(list)
74
85
maxItems.fail1: invalid value [0,1] (does not satisfy list.MaxItems(1)): len(list) > MaxItems(1) (2 > 1):
75
86
./in.cue:53:12
76
87
./in.cue:53:26
88
+ reverse.fail1.v: cannot use 1 (type int) as list in argument 1 to list.Reverse:
89
+ ./in.cue:68:15
90
+ reverse.fail2.v: cannot use "bad" (type string) as list in argument 1 to list.Reverse:
91
+ ./in.cue:69:15
77
92
78
93
Result:
79
94
import "list"
@@ -176,6 +191,28 @@ maxItems: {
176
191
ok3: [0, ...]
177
192
fail1: _|_ // maxItems.fail1: invalid value [0,1] (does not satisfy list.MaxItems(1)): len(list) > MaxItems(1) (2 > 1)
178
193
}
194
+ reverse: {
195
+ t1: {
196
+ x: []
197
+ v: []
198
+ }
199
+ t2: {
200
+ x: [1]
201
+ v: [1]
202
+ }
203
+ t3: {
204
+ x: [1, 2, 3, 4]
205
+ v: [4, 3, 2, 1]
206
+ }
207
+ fail1: {
208
+ x: 1
209
+ v: _|_ // reverse.fail1.v: cannot use 1 (type int) as list in argument 1 to list.Reverse
210
+ }
211
+ fail2: {
212
+ x: "bad"
213
+ v: _|_ // reverse.fail2.v: cannot use "bad" (type string) as list in argument 1 to list.Reverse
214
+ }
215
+ }
179
216
-- diff/-out/list-v3<==>+out/list --
180
217
diff old new
181
218
--- old
@@ -189,9 +226,9 @@ diff old new
189
226
./in.cue:53:12
190
227
./in.cue:53:26
191
228
- ./in.cue:58:9
192
-
193
- Result:
194
- import "list"
229
+ reverse.fail1.v: cannot use 1 (type int) as list in argument 1 to list.Reverse:
230
+ ./in.cue:68:15
231
+ reverse.fail2.v: cannot use "bad" (type string) as list in argument 1 to list.Reverse:
195
232
-- diff/todo/p2 --
196
233
Missing error positions.
197
234
-- out/list --
@@ -211,6 +248,10 @@ maxItems.fail1: invalid value [0,1] (does not satisfy list.MaxItems(1)): len(lis
211
248
./in.cue:53:12
212
249
./in.cue:53:26
213
250
./in.cue:58:9
251
+ reverse.fail1.v: cannot use 1 (type int) as list in argument 1 to list.Reverse:
252
+ ./in.cue:68:15
253
+ reverse.fail2.v: cannot use "bad" (type string) as list in argument 1 to list.Reverse:
254
+ ./in.cue:69:15
214
255
215
256
Result:
216
257
import "list"
@@ -313,3 +354,25 @@ maxItems: {
313
354
ok3: [0, ...]
314
355
fail1: _|_ // maxItems.fail1: invalid value [0,1] (does not satisfy list.MaxItems(1)): len(list) > MaxItems(1) (2 > 1)
315
356
}
357
+ reverse: {
358
+ t1: {
359
+ x: []
360
+ v: []
361
+ }
362
+ t2: {
363
+ x: [1]
364
+ v: [1]
365
+ }
366
+ t3: {
367
+ x: [1, 2, 3, 4]
368
+ v: [4, 3, 2, 1]
369
+ }
370
+ fail1: {
371
+ x: 1
372
+ v: _|_ // reverse.fail1.v: cannot use 1 (type int) as list in argument 1 to list.Reverse
373
+ }
374
+ fail2: {
375
+ x: "bad"
376
+ v: _|_ // reverse.fail2.v: cannot use "bad" (type string) as list in argument 1 to list.Reverse
377
+ }
378
+ }
0 commit comments