From 8503e3beec911c3f90174924aaac2ecb849a7940 Mon Sep 17 00:00:00 2001 From: Marcel van Lohuizen Date: Wed, 8 May 2024 16:57:26 +0200 Subject: [PATCH] internal/core/export: fix test 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 Change-Id: Idda917c057013619db8cd37a182f41a6f0765571 --- internal/core/export/extract_test.go | 2 + internal/core/export/testdata/main/def.txtar | 23 ---- internal/core/export/testdata/main/let.txtar | 108 ------------------- 3 files changed, 2 insertions(+), 131 deletions(-) diff --git a/internal/core/export/extract_test.go b/internal/core/export/extract_test.go index d8a926a896b..142d8e4aca5 100644 --- a/internal/core/export/extract_test.go +++ b/internal/core/export/extract_test.go @@ -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))) } diff --git a/internal/core/export/testdata/main/def.txtar b/internal/core/export/testdata/main/def.txtar index b6efad47cb4..80d407c2713 100644 --- a/internal/core/export/testdata/main/def.txtar +++ b/internal/core/export/testdata/main/def.txtar @@ -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] diff --git a/internal/core/export/testdata/main/let.txtar b/internal/core/export/testdata/main/let.txtar index 618a7a5ee5a..27dce315c1f 100644 --- a/internal/core/export/testdata/main/let.txtar +++ b/internal/core/export/testdata/main/let.txtar @@ -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]