cue icon indicating copy to clipboard operation
cue copied to clipboard

cmd/cue: package patterns match too many packages

Open rogpeppe opened this issue 1 year ago • 0 comments

What version of CUE are you using (cue version)?

$ cue version
 v0.0.0-20240610152000-475f692480d6

Does this issue reproduce with the latest stable release?

Yes (from at least v0.4.3)

What did you do?]

exec cue eval ./.../x
cmp stdout want-stdout
-- want-stdout --
self: "x"
-- cue.mod/module.cue --
module: "test.example/foo@v0"
language: version: "v0.9.0"
-- a/x/x.cue --
package x
self: "x"
-- a/y/y.cue --
package y
self: "y"

What did you expect to see?

A passing test

What did you see instead?

> exec cue eval ./.../x
[stdout]
self: "x"
// ---
self: "y"
> cmp stdout want-stdout
diff stdout want-stdout
--- stdout
+++ want-stdout
@@ -1,3 +1,1 @@
 self: "x"
-// ---
-self: "y"

FAIL: /tmp/x.txtar:2: stdout and want-stdout differ

The ./.../x pattern should match only packages named "x" but it actually matches all packages under the current directory.

rogpeppe avatar Jun 11 '24 11:06 rogpeppe