add some tests
This commit is contained in:
parent
c26c135c55
commit
dc68851233
4 changed files with 26 additions and 3 deletions
|
@ -7,3 +7,6 @@ trim_trailing_whitespace = true
|
|||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.nix]
|
||||
indent_size = 2
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
garbageProj = import ./Cargo.nix { inherit pkgs; };
|
||||
garbage; = pkgs.lib.recursiveUpdate garbageProj.rootCrate.build {
|
||||
garbage = pkgs.lib.recursiveUpdate garbageProj.rootCrate.build {
|
||||
meta = {
|
||||
description = "CLI tool to interact with the FreeDesktop trash API.";
|
||||
mainProgram = "garbage";
|
||||
|
@ -16,12 +16,12 @@
|
|||
};
|
||||
flakePkgs = {
|
||||
inherit garbage;
|
||||
tests = pkgs.callPackage ./tests { inherit garbage; };
|
||||
};
|
||||
in
|
||||
rec {
|
||||
packages = flake-utils.lib.flattenTree flakePkgs;
|
||||
checks = { tests = packages.tests; };
|
||||
defaultPackage = flakePkgs.garbage;
|
||||
});
|
||||
}
|
||||
|
||||
# vim: set ts=2 sw=2 :
|
||||
|
|
14
tests/default.nix
Normal file
14
tests/default.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ stdenv, garbage }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "garbage-tests";
|
||||
src = ./.;
|
||||
|
||||
installPhase = "mkdir -p $out";
|
||||
doCheck = true;
|
||||
|
||||
garbage = "${garbage}/bin/garbage";
|
||||
checkPhase = ''
|
||||
find . -executable -name "*.sh" | xargs bash
|
||||
'';
|
||||
}
|
6
tests/issue-1-non-unicode-paths.sh
Executable file
6
tests/issue-1-non-unicode-paths.sh
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
filename=$'\377'$'\017'$'\224'$'\353'\`$'\001'
|
||||
touch $filename
|
||||
|
||||
$garbage put $filename
|
Loading…
Reference in a new issue