cuelang.org/go@v0.10.1/internal/core/dep/testdata/topcomprehension.txtar (about)

     1  Test comprehensions that are defined above the reference root.
     2  
     3  Because the references are not at addressable locations, the printed
     4  references are bogus. However, this simply tests they are found, reported,
     5  and do not cause a crash.
     6  
     7  TODO: filter bogus references.
     8  -- in.cue --
     9  for key, value in { test: 1 } {
    10  	("a"): b: k1: key
    11  	("a"): b: v1: value
    12  	a: b: k2: key
    13  	a: b: v2: value
    14  }
    15  a: {
    16  	for key, value in { test: 1 } {
    17  		("b"): k3: key
    18  		("b"): v3: value
    19  		b: k4: key
    20  		b: v4: value
    21  	}
    22  	b: {}
    23  }
    24  -- out/dependencies/field --
    25  line  reference    path of resulting vertex
    26  -- out/dependencies/all --
    27  line  reference    path of resulting vertex
    28  4:    key       => **non-rooted**
    29  5:    value     => **non-rooted**
    30  2:    key       => **non-rooted**
    31  3:    value     => **non-rooted**
    32  -- out/dependencies-v3/dynamic --
    33  line  reference    path of resulting vertex
    34  4:    key       => **non-rooted**
    35  5:    value     => **non-rooted**
    36  2:    key       => **non-rooted**
    37  3:    value     => **non-rooted**
    38  11:   key       => **non-rooted**
    39  12:   value     => **non-rooted**
    40  9:    key       => **non-rooted**
    41  10:   value     => **non-rooted**
    42  -- diff/-out/dependencies-v3/dynamic<==>+out/dependencies/dynamic --
    43  diff old new
    44  --- old
    45  +++ new
    46  @@ -1,9 +1,9 @@
    47   line  reference    path of resulting vertex
    48   4:    key       => **non-rooted**
    49   5:    value     => **non-rooted**
    50  -11:   key       => **non-rooted**
    51  -12:   value     => **non-rooted**
    52   2:    key       => **non-rooted**
    53   3:    value     => **non-rooted**
    54  +11:   key       => **non-rooted**
    55  +12:   value     => **non-rooted**
    56   9:    key       => **non-rooted**
    57   10:   value     => **non-rooted**
    58  -- diff/dependencies/todo/p3 --
    59  Reordering.
    60  -- out/dependencies/dynamic --
    61  line  reference    path of resulting vertex
    62  4:    key       => **non-rooted**
    63  5:    value     => **non-rooted**
    64  11:   key       => **non-rooted**
    65  12:   value     => **non-rooted**
    66  2:    key       => **non-rooted**
    67  3:    value     => **non-rooted**
    68  9:    key       => **non-rooted**
    69  10:   value     => **non-rooted**