depot/third_party/nixpkgs/pkgs/by-name/ma/maid/test.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

20 lines
411 B
Nix

{ runCommandLocal, maid }:
runCommandLocal "test-maid-run" {
nativeBuildInputs = [ maid ];
}
''
mkdir -p $out/test
export HOME=$out
cd $out
touch test/a.iso test/b.txt
cat > rules.rb <<EOF
Maid.rules do
rule 'ISO' do
trash(dir('test/*.iso'))
end
end
EOF
maid clean --rules rules.rb --force
[ -f test/b.txt ] && [ ! -f test/a.iso ]
''