Skip to content

Commit 677ece8

Browse files
committed
cmd/cue: add test cases for embedding files inside symlink dirs
This is different than embedding a symlink itself, as we follow a symlink as part of traversing a directory to open a regular file or match a glob resulting in regular files. For #3299. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I1c02a64a442b2a1c29192a29171b0ad6a903b43e Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1199041 Reviewed-by: Roger Peppe <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent 4d941df commit 677ece8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

cmd/cue/cmd/testdata/script/embed_err.txtar

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ cmp stderr out/err
1212
cd symlink
1313
symlink symlink.json -> test.json
1414
symlink symlink-parent.json -> ../test.json
15+
symlink symlink-dir -> y
1516
exec cue eval .
1617
cmp stdout out/std
1718

@@ -177,8 +178,14 @@ package symlink
177178
file: _ @embed(file=symlink.json)
178179

179180
glob: _ @embed(glob="*.json")
181+
182+
fileSymlinkDir: _ @embed(file=symlink-dir/test.json)
183+
184+
globSymlinkDir: _ @embed(glob="symlink-dir/*.json")
180185
-- symlink/test.json --
181186
{ "x": "symlink target file" }
187+
-- symlink/y/test.json --
188+
{ "y": "another symlink target file" }
182189
-- symlink/out/std --
183190
file: {
184191
x: "symlink target file"
@@ -194,3 +201,11 @@ glob: {
194201
x: "symlink target file"
195202
}
196203
}
204+
fileSymlinkDir: {
205+
y: "another symlink target file"
206+
}
207+
globSymlinkDir: {
208+
"symlink-dir/test.json": {
209+
y: "another symlink target file"
210+
}
211+
}

0 commit comments

Comments
 (0)