compress-drv-tests

compress-drv-tests
Motiejus Jakštys 2024-02-24 19:43:19 +02:00
parent 934467dfb8
commit c0d6d22169
1 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,30 @@
{
#lib,
gzip,
stdenv,
compressDrv,
}: let
#example = stdenv.runCommandNoCC "sample-drv" {} ''
# mkdir $out
# echo 1 > $out/1.txt
# touch $out/2.png
#'';
drv = compressDrv {
formats = ["txt"];
compressors = ["gz"];
compressor-gz = "${gzip}/bin/gzip --fast {}";
};
in
stdenv.runCommandNoCC "test-compressDrv" {} ''
set -ex
find .
find ${drv}
test -h ${drv}/1.txt
test -f ${drv}/1.txt.gz
test cmp ${drv}/1.txt <(${gzip}/bin/zcat ${drv}/1.txt.gz)
test -h ${drv}/2.png
test ! -a ${drv}/2.png.gz
exit 1
''