about summary refs log tree commit diff
path: root/pkgs/shells
diff options
context:
space:
mode:
authorChristian Kampka <christian@kampka.net>2022-01-17 12:17:55 +0100
committerChristian Kampka <christian@kampka.net>2022-01-17 13:37:04 +0100
commitce00fa6d26ec7cb4647b82b72611b42ae1c49ed0 (patch)
tree1666e95d27f4192847fe409aea99c050c66a7592 /pkgs/shells
parent1ea75adb020b250a8459b6cadcb66543b6c1e217 (diff)
dash: add test
Diffstat (limited to 'pkgs/shells')
-rw-r--r--pkgs/shells/dash/default.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkgs/shells/dash/default.nix b/pkgs/shells/dash/default.nix
index 2a0d731456076..a1f789dc3a330 100644
--- a/pkgs/shells/dash/default.nix
+++ b/pkgs/shells/dash/default.nix
@@ -5,6 +5,8 @@
 , fetchurl
 , fetchpatch
 , libedit
+, runCommand
+, dash
 }:
 
 stdenv.mkDerivation rec {
@@ -52,5 +54,13 @@ stdenv.mkDerivation rec {
 
   passthru = {
     shellPath = "/bin/dash";
+    tests = {
+      "execute-simple-command" = runCommand "${pname}-execute-simple-command" { } ''
+        mkdir $out
+        ${dash}/bin/dash -c 'echo "Hello World!" > $out/success'
+        [ -s $out/success ]
+        grep -q "Hello World" $out/success
+      '';
+    };
   };
 }