diff --git a/cmd/unity/cmd/project.go b/cmd/unity/cmd/project.go index e311789..b8e0722 100644 --- a/cmd/unity/cmd/project.go +++ b/cmd/unity/cmd/project.go @@ -436,7 +436,9 @@ func (mt *moduleTester) deriveModules(dir string) (modules []*module, err error) return fmt.Errorf("failed to create module instance at %s: %v", modDir, err) } modules = append(modules, m) - return nil + // Do not recurse within the cue.mod - otherwise we might find modules + // in the vendor + return filepath.SkipDir }) return } diff --git a/cmd/unity/cmd/testdata/scripts/test_project_simple.txt b/cmd/unity/cmd/testdata/scripts/test_project_simple.txt index 6e7dd51..1930f73 100644 --- a/cmd/unity/cmd/testdata/scripts/test_project_simple.txt +++ b/cmd/unity/cmd/testdata/scripts/test_project_simple.txt @@ -17,6 +17,12 @@ stdout 'PASS' -- .unquote -- cue.mod/tests/basic1.txt cue.mod/tests/basic2.txt +-- cue.mod/pkg/acme.com/other/other.cue -- +package other + +y: 5 +-- cue.mod/pkg/acme.com/other/cue.mod/module.cue -- +module: "acme.com/other" -- cue.mod/module.cue -- module: "mod.com" @@ -40,4 +46,6 @@ Versions: ["PATH"] -- x.cue -- package x -x: 5 +import "acme.com/other" + +x: other.y