...

Text file src/cuelang.org/go/pkg/list/testdata/issues.txtar

Documentation: cuelang.org/go/pkg/list/testdata

     1-- in.cue --
     2import "list"
     3
     4issue563: {
     5	#MyDef: {
     6		name: string
     7		...
     8	}
     9
    10	_all: [
    11		_a,
    12		_b,
    13	]
    14
    15	_a: [...#MyDef] & [
    16		{name: "a"},
    17		{name: "b"},
    18		{name: "c"},
    19	]
    20
    21	_b: [...#MyDef] & [
    22		{name: "1"},
    23		{name: "2"},
    24		{name: "3"},
    25	]
    26
    27	output: [...#MyDef] & list.FlattenN(_all, 1)
    28}
    29issue1404: {
    30	a:   *1 | 2
    31	sum: list.Sum([a])
    32}
    33-- out/list --
    34issue563: {
    35	#MyDef: {
    36		name: string
    37	}
    38	output: [{
    39		name: "a"
    40	}, {
    41		name: "b"
    42	}, {
    43		name: "c"
    44	}, {
    45		name: "1"
    46	}, {
    47		name: "2"
    48	}, {
    49		name: "3"
    50	}]
    51}
    52issue1404: {
    53	a:   *1 | 2
    54	sum: 1
    55}

View as plain text