Skip to content

Commit 2742aba

Browse files
committed
cmd/cue, internal/mod/modimports: add test cases for issue 3795
This CL adds some failing test cases for #3795. The fix will come in subsequent CLs. Signed-off-by: Roger Peppe <[email protected]> Change-Id: I33edf403f0ad1a99c87a9b0544f4993a75059182 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1211241 Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent 9ba4189 commit 2742aba

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

cmd/cue/cmd/testdata/script/eval_hidden.txtar

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ exec cue eval _foo.cue
77
cmp stdout expect-stdout-underscore
88

99
# Ensure package eval excludes both for completeness
10-
exec cue eval .
11-
cmp stdout expect-stdout-pkg
10+
# TODO fix this
11+
! exec cue eval .
12+
cmp stderr expect-stderr-pkg
13+
# cmp stdout expect-stdout-pkg
1214

1315
-- .foo.cue --
1416
package foo
@@ -18,6 +20,8 @@ a: 42
1820
package foo
1921

2022
b: 42
23+
-- .bar.cue --
24+
package bar
2125
-- foo.cue --
2226
package foo
2327

@@ -28,3 +32,5 @@ a: 42
2832
b: 42
2933
-- expect-stdout-pkg --
3034
c: 42
35+
-- expect-stderr-pkg --
36+
found packages "bar" (.bar.cue) and "foo" (.foo.cue) in "."

cmd/cue/cmd/testdata/script/pkg_resolution_multiple_packages_build_attr.txtar

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,24 @@
22
# what packages it resolves to.
33

44
exec cue eval ./...
5-
cmp stdout stdout.golden
5+
cmp stdout eval-all.golden
66

77
! exec cue eval -t something ./...
88
stderr '^found packages "x" \(x.cue\) and "y" \(y.cue\) in ".*x"$'
99

10-
-- stdout.golden --
10+
# Test that a non-wildcard pattern similarly respects
11+
# build attributes.
12+
13+
cd x
14+
! exec cue eval
15+
cmp stderr $WORK/eval-x.golden
16+
17+
-- eval-all.golden --
1118
x: 5
1219
// ---
1320
x: 5
21+
-- eval-x.golden --
22+
found packages "x" (x.cue) and "y" (y.cue) in "x"
1423
-- cue.mod/module.cue --
1524
module: "mod.com"
1625
language: version: "v0.9.0"

internal/mod/modimports/testdata/simple.txtar

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
TODO fix code so it does not include "hidden" CUE files
12
-- want --
23
x.cue "dep1" "dep2:a" "dep2:b" "dep3"
34
z.cue
5+
y/.omitted.cue
6+
y/_omitted.cue
47
y/y1.cue "dep3" "dep4"
58
y/y2.cue
69
y/z1.cue
@@ -41,6 +44,12 @@ package z
4144
-- y/z2.cue --
4245
package z
4346

47+
-- y/.omitted.cue --
48+
package foo
49+
50+
-- y/_omitted.cue --
51+
package foo
52+
4453
-- z.cue --
4554
package example
4655

0 commit comments

Comments
 (0)