diff --git a/pkgs/development/interpreters/tinyscheme/default.nix b/pkgs/development/interpreters/tinyscheme/default.nix index 7d064432a732..1bdc2ef82f23 100644 --- a/pkgs/development/interpreters/tinyscheme/default.nix +++ b/pkgs/development/interpreters/tinyscheme/default.nix @@ -1,4 +1,10 @@ -{ lib, stdenv, fetchurl, dos2unix }: +{ lib +, stdenv +, fetchurl +, dos2unix +, runCommand +, tinyscheme +}: stdenv.mkDerivation rec { pname = "tinyscheme"; @@ -38,6 +44,28 @@ stdenv.mkDerivation rec { cp scheme $out/bin/tinyscheme ''; + passthru.tests = { + # Checks that the program can run and exit: + simple = runCommand "${pname}-simple-test" {} '' + ${tinyscheme}/bin/tinyscheme <<<"(quit 0)" + echo "success" > $out + ''; + fileIo = runCommand "${pname}-file-io-test" {} '' + ${tinyscheme}/bin/tinyscheme < $out || : + [[ "$(cat $out)" =~ ^Usage: ]] + ''; + }; + meta = with lib; { description = "Lightweight Scheme implementation"; longDescription = ''