|
| 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 | +#TOO: {too: int} |
| 16 | +-- out/list-v3 -- |
| 17 | +Errors: |
| 18 | +t1.l1: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(>0, [string])): number of matched elements is 0: does not satisfy >0: |
| 19 | + ./in.cue:6:6 |
| 20 | + ./in.cue:6:18 |
| 21 | +t1.l2: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(1, number)): number of matched elements is 3: does not satisfy 1: |
| 22 | + ./in.cue:7:6 |
| 23 | + ./in.cue:7:18 |
| 24 | + ./in.cue:7:21 |
| 25 | +t1.l3: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(>1, string)): number of matched elements is 1: does not satisfy >1: |
| 26 | + ./in.cue:8:6 |
| 27 | + ./in.cue:8:18 |
| 28 | + ./in.cue:8:22 |
| 29 | +t1.l4: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(0, number)): number of matched elements is 3: does not satisfy 0: |
| 30 | + ./in.cue:9:6 |
| 31 | + ./in.cue:9:18 |
| 32 | + ./in.cue:9:21 |
| 33 | +t1.l5: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(string, [int])): number of matched elements is 1: does not satisfy string: |
| 34 | + ./in.cue:10:6 |
| 35 | + ./in.cue:10:18 |
| 36 | +t1.l6: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(>0, {too:int})): number of matched elements is 0: does not satisfy >0: |
| 37 | + ./in.cue:11:6 |
| 38 | + ./in.cue:11:18 |
| 39 | + |
| 40 | +Result: |
| 41 | +t1: { |
| 42 | + l1: _|_ // t1.l1: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(>0, [string])): number of matched elements is 0: does not satisfy >0 |
| 43 | + l2: _|_ // t1.l2: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(1, number)): number of matched elements is 3: does not satisfy 1 |
| 44 | + l3: _|_ // t1.l3: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(>1, string)): number of matched elements is 1: does not satisfy >1 |
| 45 | + l4: _|_ // t1.l4: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(0, number)): number of matched elements is 3: does not satisfy 0 |
| 46 | + l5: _|_ // t1.l5: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(string, [int])): number of matched elements is 1: does not satisfy string |
| 47 | + l6: _|_ // t1.l6: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(>0, {too:int})): number of matched elements is 0: does not satisfy >0 |
| 48 | +} |
| 49 | +#TOO: { |
| 50 | + too: int |
| 51 | +} |
| 52 | +-- out/list -- |
| 53 | +Errors: |
| 54 | +t1.l1: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(>0, [string])): number of matched elements is 0: does not satisfy >0: |
| 55 | + ./in.cue:6:6 |
| 56 | + ./in.cue:4:12 |
| 57 | + ./in.cue:6:18 |
| 58 | +t1.l2: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(1, number)): number of matched elements is 3: does not satisfy 1: |
| 59 | + ./in.cue:7:6 |
| 60 | + ./in.cue:4:12 |
| 61 | + ./in.cue:7:18 |
| 62 | + ./in.cue:7:21 |
| 63 | +t1.l3: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(>1, string)): number of matched elements is 1: does not satisfy >1: |
| 64 | + ./in.cue:8:6 |
| 65 | + ./in.cue:4:12 |
| 66 | + ./in.cue:8:18 |
| 67 | + ./in.cue:8:22 |
| 68 | +t1.l4: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(0, number)): number of matched elements is 3: does not satisfy 0: |
| 69 | + ./in.cue:9:6 |
| 70 | + ./in.cue:4:12 |
| 71 | + ./in.cue:9:18 |
| 72 | + ./in.cue:9:21 |
| 73 | +t1.l5: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(string, [int])): number of matched elements is 1: does not satisfy string: |
| 74 | + ./in.cue:10:6 |
| 75 | + ./in.cue:4:12 |
| 76 | + ./in.cue:10:18 |
| 77 | +t1.l6: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(>0, {too:int})): number of matched elements is 0: does not satisfy >0: |
| 78 | + ./in.cue:11:6 |
| 79 | + ./in.cue:4:12 |
| 80 | + ./in.cue:11:18 |
| 81 | + |
| 82 | +Result: |
| 83 | +t1: { |
| 84 | + l1: _|_ // t1.l1: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(>0, [string])): number of matched elements is 0: does not satisfy >0 |
| 85 | + l2: _|_ // t1.l2: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(1, number)): number of matched elements is 3: does not satisfy 1 |
| 86 | + l3: _|_ // t1.l3: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(>1, string)): number of matched elements is 1: does not satisfy >1 |
| 87 | + l4: _|_ // t1.l4: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(0, number)): number of matched elements is 3: does not satisfy 0 |
| 88 | + l5: _|_ // t1.l5: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(string, [int])): number of matched elements is 1: does not satisfy string |
| 89 | + l6: _|_ // t1.l6: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN(>0, {too:int})): number of matched elements is 0: does not satisfy >0 |
| 90 | +} |
| 91 | +#TOO: { |
| 92 | + too: int |
| 93 | +} |
0 commit comments