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
|
charset = utf-8
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
|
||||||
|
[*.nix]
|
||||||
|
indent_size = 2
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
let
|
let
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
garbageProj = import ./Cargo.nix { inherit pkgs; };
|
garbageProj = import ./Cargo.nix { inherit pkgs; };
|
||||||
garbage; = pkgs.lib.recursiveUpdate garbageProj.rootCrate.build {
|
garbage = pkgs.lib.recursiveUpdate garbageProj.rootCrate.build {
|
||||||
meta = {
|
meta = {
|
||||||
description = "CLI tool to interact with the FreeDesktop trash API.";
|
description = "CLI tool to interact with the FreeDesktop trash API.";
|
||||||
mainProgram = "garbage";
|
mainProgram = "garbage";
|
||||||
|
@ -16,12 +16,12 @@
|
||||||
};
|
};
|
||||||
flakePkgs = {
|
flakePkgs = {
|
||||||
inherit garbage;
|
inherit garbage;
|
||||||
|
tests = pkgs.callPackage ./tests { inherit garbage; };
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
rec {
|
rec {
|
||||||
packages = flake-utils.lib.flattenTree flakePkgs;
|
packages = flake-utils.lib.flattenTree flakePkgs;
|
||||||
|
checks = { tests = packages.tests; };
|
||||||
defaultPackage = flakePkgs.garbage;
|
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