cuelang.org/go@v0.13.0/pkg/list/testdata/matchn_err.txtar (about) 1 -- in.cue -- 2 import "list" 3 4 t1: { 5 [=~"^l"]: [1, 2, 3, "str", [1], { foo: 1 }] 6 7 l1: list.MatchN(>0, [string]) 8 l2: list.MatchN(1, number) 9 l3: list.MatchN(>1, string) 10 l4: list.MatchN(0, number) 11 l5: list.MatchN(string, [int]) 12 l6: list.MatchN(>0, #TOO) 13 } 14 15 issue3519: { 16 a: [{}] 17 a: list.MatchN(1, {a!: _}) 18 } 19 20 #TOO: {too: int} 21 -- out/list -- 22 Errors: 23 t1.l1: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 0: does not satisfy >0: 24 ./in.cue:6:6 25 ./in.cue:4:12 26 ./in.cue:6:18 27 t1.l2: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 3: does not satisfy 1: 28 ./in.cue:7:6 29 ./in.cue:4:12 30 ./in.cue:7:18 31 ./in.cue:7:21 32 t1.l3: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 1: does not satisfy >1: 33 ./in.cue:8:6 34 ./in.cue:4:12 35 ./in.cue:8:18 36 ./in.cue:8:22 37 t1.l4: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 3: does not satisfy 0: 38 ./in.cue:9:6 39 ./in.cue:4:12 40 ./in.cue:9:18 41 ./in.cue:9:21 42 t1.l5: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 1: does not satisfy string: 43 ./in.cue:10:6 44 ./in.cue:4:12 45 ./in.cue:10:18 46 t1.l6: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 0: does not satisfy >0: 47 ./in.cue:11:6 48 ./in.cue:4:12 49 ./in.cue:11:18 50 issue3519.a: invalid value [{}] (does not satisfy list.MatchN): number of matched elements is 0: does not satisfy 1: 51 ./in.cue:16:8 52 ./in.cue:15:8 53 ./in.cue:16:20 54 55 Result: 56 t1: { 57 l1: _|_ // t1.l1: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 0: does not satisfy >0 58 l2: _|_ // t1.l2: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 3: does not satisfy 1 59 l3: _|_ // t1.l3: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 1: does not satisfy >1 60 l4: _|_ // t1.l4: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 3: does not satisfy 0 61 l5: _|_ // t1.l5: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 1: does not satisfy string 62 l6: _|_ // t1.l6: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 0: does not satisfy >0 63 } 64 issue3519: { 65 a: _|_ // issue3519.a: invalid value [{}] (does not satisfy list.MatchN): number of matched elements is 0: does not satisfy 1 66 } 67 #TOO: { 68 too: int 69 }