this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

cmd/cue: test that package paths outside the module are rejected

When a package argument resolves to a directory outside the current
module, loading fails with a "dir outside of root" error from the
importer. Add a testscript case that exercises this via a relative
path from a nested sub-module.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I84d17d7c0cbfa9933d25c9a07f5d0261e8c858f8
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1236164
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>

+13
+13
cmd/cue/cmd/testdata/script/cmd_filetypes.txtar
··· 59 59 [!windows] stderr 'cannot use absolute directory ".*somefile" as package path' 60 60 [windows] stderr 'no encoding specified for file ".*somefile"' 61 61 62 + # A package path pointing outside the current module is rejected. 63 + cd nested 64 + ! exec cue export ./../somepkg 65 + stderr 'cannot determine import path for "\./\.\./somepkg" \(dir outside of root\)' 66 + cd ${WORK} 67 + 62 68 -- cue.mod/module.cue -- 63 69 module: "mod.test/test" 64 70 language: version: "v0.9.0" ··· 68 74 package somepkg 69 75 70 76 a: 5 77 + -- nested/cue.mod/module.cue -- 78 + module: "mod.test/nested" 79 + language: version: "v0.9.0" 80 + -- nested/x.cue -- 81 + package nested 82 + 83 + a: 1 71 84 -- export.golden -- 72 85 { 73 86 "a": 5