summaryrefslogtreecommitdiff
path: root/lib/fileset/tests.sh
diff options
context:
space:
mode:
authorSilvan Mosberger <silvan.mosberger@tweag.io>2023-09-13 22:26:16 +0200
committerSilvan Mosberger <silvan.mosberger@tweag.io>2023-09-13 23:32:14 +0200
commit7d4eb3f1b7c74b3812c1873b6136a18387310bb8 (patch)
tree972ba50954d3dfc893d31b0fa8c6a2c6bcf31351 /lib/fileset/tests.sh
parentlib.fileset: Internal representation v1 (diff)
downloadnixpkgs-7d4eb3f1b7c74b3812c1873b6136a18387310bb8.tar.gz
lib.fileset.toSource: Evaluate fileset even for empty directories
Diffstat (limited to 'lib/fileset/tests.sh')
-rwxr-xr-xlib/fileset/tests.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/fileset/tests.sh b/lib/fileset/tests.sh
index e27610573a86..5bd798ae7942 100755
--- a/lib/fileset/tests.sh
+++ b/lib/fileset/tests.sh
@@ -246,6 +246,9 @@ expectFailure 'toSource { root = ./a; fileset = ./a; }' 'lib.fileset.toSource: `
\s*- If you want to import the file into the store _with_ a containing directory, set `root` to the containing directory, such as '"$work"', and set `fileset` to the file path.'
rm -rf *
+# The fileset argument should be evaluated, even if the directory is empty
+expectFailure 'toSource { root = ./.; fileset = abort "This should be evaluated"; }' 'evaluation aborted with the following error message: '\''This should be evaluated'\'
+
# Only paths under `root` should be able to influence the result
mkdir a
expectFailure 'toSource { root = ./a; fileset = ./.; }' 'lib.fileset.toSource: `fileset` could contain files in '"$work"', which is not under the `root` '"$work"'/a. Potential solutions: