Skip to content

Commit

Permalink
internal/core/export: fix test
Browse files Browse the repository at this point in the history
When iterating over arcs, one now has to dereference
the value to use it. The CUE API does this, but since
the test used the low-level API, it now needs to be done
manually.

Issue #2884

Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: Idda917c057013619db8cd37a182f41a6f0765571
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194465
Unity-Result: CUE porcuepine <[email protected]>
Reviewed-by: Daniel Martí <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
  • Loading branch information
mpvl committed May 13, 2024
1 parent 5f8930a commit 07d485c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 131 deletions.
2 changes: 2 additions & 0 deletions internal/core/export/extract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ func writeDocs(t *cuetxtar.Test, r adt.Runtime, v *adt.Vertex, path []string) {
fmt.Fprintln(t, "-", c.Text())
}

// Simulate the dereference behavior that is implemented in the CUE api.
v = v.DerefValue()
for _, a := range v.Arcs {
writeDocs(t, r, a, append(path, a.Label.SelectorString(r)))
}
Expand Down
23 changes: 0 additions & 23 deletions internal/core/export/testdata/main/def.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,6 @@ c: {

// Issue #2305
g: #d
-- out/doc-v3 --
[]
[a]
[b]
[c]
[#d]
[#d e]
[#d f]
[g]
- Issue #2305

-- diff/-out/doc-v3<==>+out/doc --
diff old new
--- old
+++ new
@@ -8,5 +8,3 @@
[g]
- Issue #2305

-[g e]
-[g f]
-- diff/doc/todo/p1 --
Two missing entries.
-- out/doc --
[]
[a]
Expand Down
108 changes: 0 additions & 108 deletions internal/core/export/testdata/main/let.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -269,114 +269,6 @@ unresolvedDisjunction: {
}
}
y: Y & Y_1
-- out/doc-v3 --
[]
[comprehension]
[comprehension filepath]
[X]
[#Foo]
[complete]
[complete A]
[complete x]
[complete run]
[complete run a]
[incomplete]
[incomplete a]
[incomplete a x]
[incomplete a run]
[incomplete a run a]
[incomplete b]
[incomplete b A]
[incomplete b x]
[incomplete b run]
[incomplete b run a]
[incomplete c]
[incomplete c A]
[incomplete c x]
[incomplete c run]
[incomplete c run a]
[incomplete c A]
[incomplete c x2]
[incomplete c run2]
[incomplete c run2 a]
[incomplete d]
[incomplete d A]
[incomplete d x]
[incomplete d run]
[incomplete d run a]
[incomplete d A]
[incomplete d x2]
[incomplete d run2]
[incomplete d run2 a]
[unresolvedDisjunction]
[unresolvedDisjunction #TypePrimitive]
[unresolvedDisjunction #TypeBool]
[unresolvedDisjunction #TypeBool _args]
[unresolvedDisjunction #TypeBool _args required]
[unresolvedDisjunction #TypeBool Args]
[unresolvedDisjunction #TypeBool Args required]
[cfgs]
[cfgs 0]
[cfgs 0 metadata]
[cfgs 0 metadata name]
[cfgs 1]
[cfgs 1 metadata]
[cfgs 1 metadata name]
[filepath]
[files]
[scoped]
[scoped _args]
[scoped _args required]
[scoped direct]
[scoped direct Args]
[scoped direct Args required]
[scoped direct a]
[scoped embed1]
[scoped embed1 Args]
[scoped embed1 Args required]
[scoped embed1 a]
[scoped embed2]
[scoped embed2 Args]
[scoped embed2 Args required]
[scoped embed2 a]
[scoped list]
[scoped list Args]
[scoped list Args required]
[scoped list a]
[scoped list a 0]
[scoped listStruct]
[scoped listStruct Args]
[scoped listStruct Args required]
[scoped listStruct a]
[scoped listStruct a 0]
[scoped listStruct a 0 a]
[scoped listEmbed]
[scoped listEmbed Args]
[scoped listEmbed Args required]
[scoped listEmbed a]
[scoped listEmbed a 0]
[x]
[Y]
[y]
[Y]
-- diff/-out/doc-v3<==>+out/doc --
diff old new
--- old
+++ new
@@ -38,11 +38,6 @@
[incomplete d run2 a]
[unresolvedDisjunction]
[unresolvedDisjunction #TypePrimitive]
-[unresolvedDisjunction #TypePrimitive _args]
-[unresolvedDisjunction #TypePrimitive _args required]
-[unresolvedDisjunction #TypePrimitive Args]
-[unresolvedDisjunction #TypePrimitive Args required]
-[unresolvedDisjunction #TypePrimitive "*"]
[unresolvedDisjunction #TypeBool]
[unresolvedDisjunction #TypeBool _args]
[unresolvedDisjunction #TypeBool _args required]
-- diff/doc/todo/p1 --
Missing lines.
-- out/doc --
[]
[comprehension]
Expand Down

0 comments on commit 07d485c

Please sign in to comment.