X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=t%2Fextract.t;h=0b8a6100bf2d01ef3cdb0efe268ae39e9cca89c4;hb=77544f57c8617cf232cdf21e02924ae03d4da685;hp=17b2faa2da8a8f8797386a51621d48c9e7ed18be;hpb=7b53df56cc94695572fa6ea8b075cf7e89b3690c;p=zpackage diff --git a/t/extract.t b/t/extract.t index 17b2faa..0b8a610 100755 --- a/t/extract.t +++ b/t/extract.t @@ -1,30 +1,34 @@ #!/bin/sh -# test addfile - . tap.sh -plan 4 +plan 6 PF=test.db rm -f $PF test.foo echo foo > test.foo +zpm init test.db +okexit create extract test db + hash=$(zpm-addfile $PF test.foo 2>> test.out) save=$? okexit add foo file content -okstreq $hash b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c foo hash contents +okstreq "$hash" b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c foo hash contents rm -f foo -zpm-extract $PF $hash test.foo2 +zpm-extract -f $PF $hash test.foo2 okexit extract foo file content sha=$(zpm-hash test.foo2) okstreq $hash $sha extracted hash matches +sha=$(zpm-extract -f $PF $hash - | zpm-hash) +okstreq $hash $sha stdout extract hash matches + finish rm -f test.*