cuelang.org/go@v0.13.0/pkg/list/testdata/matchn.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(1, string)
     8  	l2: list.MatchN(3, number)
     9  	l3: list.MatchN(>=1, number)
    10  	l4: list.MatchN(1, [int])
    11  	l5: list.MatchN(1, {foo: int})
    12  	l6: list.MatchN(1, 1)
    13  	l7: list.MatchN(1, "str")
    14  	l8: list.MatchN(>0, "str")
    15  	l9: list.MatchN(1, {foo: 1})
    16  	l10: list.MatchN(0, #TOO)
    17  	l11: list.MatchN(0, [string])
    18  	l12: list.MatchN(3, int | *1)
    19  	l13: list.MatchN(2, 2 | *1)
    20  	l14: list.MatchN(1 | 2, 2 | *1)
    21  
    22  	c1: ["xx", 1, 2, 3] | [1]
    23  	c1: list.MatchN(>=2, 1 | *2)
    24  }
    25  #TOO: {too: int}
    26  -- out/list --
    27  t1: {
    28  	l1: [1, 2, 3, "str", [1], {
    29  		foo: 1
    30  	}]
    31  	l2: [1, 2, 3, "str", [1], {
    32  		foo: 1
    33  	}]
    34  	l3: [1, 2, 3, "str", [1], {
    35  		foo: 1
    36  	}]
    37  	l4: [1, 2, 3, "str", [1], {
    38  		foo: 1
    39  	}]
    40  	l5: [1, 2, 3, "str", [1], {
    41  		foo: 1
    42  	}]
    43  	l6: [1, 2, 3, "str", [1], {
    44  		foo: 1
    45  	}]
    46  	l7: [1, 2, 3, "str", [1], {
    47  		foo: 1
    48  	}]
    49  	l8: [1, 2, 3, "str", [1], {
    50  		foo: 1
    51  	}]
    52  	l9: [1, 2, 3, "str", [1], {
    53  		foo: 1
    54  	}]
    55  	l10: [1, 2, 3, "str", [1], {
    56  		foo: 1
    57  	}]
    58  	l11: [1, 2, 3, "str", [1], {
    59  		foo: 1
    60  	}]
    61  	l12: [1, 2, 3, "str", [1], {
    62  		foo: 1
    63  	}]
    64  	l13: [1, 2, 3, "str", [1], {
    65  		foo: 1
    66  	}]
    67  	l14: [1, 2, 3, "str", [1], {
    68  		foo: 1
    69  	}]
    70  	c1: ["xx", 1, 2, 3]
    71  }
    72  #TOO: {
    73  	too: int
    74  }