about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorSilvan Mosberger <silvan.mosberger@tweag.io>2023-10-26 01:53:39 +0200
committerSilvan Mosberger <silvan.mosberger@tweag.io>2023-10-26 01:57:22 +0200
commit88f736f871452cf064689b4098bc92bfb5aef070 (patch)
tree24bfacd9728335837aeec68e211e21ef360e5255 /lib
parent7227cb1d734a2a3ce19a7ce94d5541e03ed1582c (diff)
lib.fileset.toSource: Test with unknown file type
Currently just throws the Nix error because unknown file types are not
supported by the Nix store, but nothing catches this error earlier (yet,
see next commit)
Diffstat (limited to 'lib')
-rwxr-xr-xlib/fileset/tests.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/fileset/tests.sh b/lib/fileset/tests.sh
index 6a57177d14d4a..86ef1989f60b5 100755
--- a/lib/fileset/tests.sh
+++ b/lib/fileset/tests.sh
@@ -354,6 +354,11 @@ expectFailure 'toSource { root = ./a; fileset = ./.; }' 'lib.fileset.toSource: `
 \s*- Set `fileset` to a file set that cannot contain files outside the `root` \('"$work"'/a\). This could change the files included in the result.'
 rm -rf -- *
 
+# non-regular and non-symlink files cannot be added to the Nix store
+mkfifo a
+expectFailure 'toSource { root = ./.; fileset = ./a; }' 'file '\'"$work"'/a'\'' has an unsupported type'
+rm -rf -- *
+
 # Path coercion only works for paths
 expectFailure 'toSource { root = ./.; fileset = 10; }' 'lib.fileset.toSource: `fileset` is of type int, but it should be a file set or a path instead.'
 expectFailure 'toSource { root = ./.; fileset = "/some/path"; }' 'lib.fileset.toSource: `fileset` \("/some/path"\) is a string-like value, but it should be a file set or a path instead.