Skip to content

Commit deae2a0

Browse files
committed
cue/load: add test for imports in "all package" mode
This highlights a current bug that imports do not work correctly when `load.Config.Package` is "*". This bug will be fixed in a subsequent CL. Signed-off-by: Roger Peppe <[email protected]> Change-Id: Ic58a1bdfb8f570b95704795ebe4e10e76b036a9c Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1201521 Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent 082fd40 commit deae2a0

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

cue/load/loader_test.go

+25-1
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,31 @@ dir: $CWD/testdata/testmod/issue3306/x
612612
display:./issue3306/x
613613
files:
614614
$CWD/testdata/testmod/issue3306/x.cue
615-
$CWD/testdata/testmod/issue3306/x/x.cue`}}
615+
$CWD/testdata/testmod/issue3306/x/x.cue`}, {
616+
// This test checks that when we use Package: "*",
617+
// we can still use imported packages.
618+
name: "AllPackagesWithImports",
619+
cfg: &Config{
620+
Dir: testdataDir,
621+
Package: "*",
622+
},
623+
args: []string{"."},
624+
want: `path: mod.test/test@v0:_
625+
module: mod.test/test@v0
626+
root: $CWD/testdata/testmod
627+
dir: $CWD/testdata/testmod
628+
display:.
629+
files:
630+
$CWD/testdata/testmod/anon.cue
631+
632+
path: mod.test/test@v0:test
633+
module: mod.test/test@v0
634+
root: $CWD/testdata/testmod
635+
dir: $CWD/testdata/testmod
636+
display:.
637+
files:
638+
$CWD/testdata/testmod/test.cue`,
639+
}}
616640
tdtest.Run(t, testCases, func(t *tdtest.T, tc *loadTest) {
617641
pkgs := Instances(tc.args, tc.cfg)
618642

0 commit comments

Comments
 (0)