about summary refs log tree commit diff
path: root/tests/filter-source.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tests/filter-source.nix')
-rw-r--r--tests/filter-source.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/filter-source.nix b/tests/filter-source.nix
new file mode 100644
index 000000000000..a620f0fda5c4
--- /dev/null
+++ b/tests/filter-source.nix
@@ -0,0 +1,12 @@
+with import ./config.nix;
+
+mkDerivation {
+  name = "filter";
+  builder = builtins.toFile "builder" "ln -s $input $out";
+  input =
+    let filter = path: type:
+      type != "symlink"
+      && baseNameOf path != "foo"
+      && !((import ./lang/lib.nix).hasSuffix ".bak" (baseNameOf path));
+    in builtins.filterSource filter ./test-tmp/filterin;
+}