Debian Codegraph @

internal/core/dep/testdata/topcomprehension.txtar

raw
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/dynamic --
33 line reference path of resulting vertex
34 4: key => **non-rooted**
35 5: value => **non-rooted**
36 11: key => **non-rooted**
37 12: value => **non-rooted**
38 2: key => **non-rooted**
39 3: value => **non-rooted**
40 9: key => **non-rooted**
41 10: value => **non-rooted**
42 -- out/dependencies-v3/stats/field --
43 // COUNT: 0
44 -- out/dependencies-v3/stats/all --
45 // COUNT: 8
46 -- out/dependencies-v3/stats/dynamic --
47 // COUNT: 16