X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=t%2Fextract.t;h=203cc3841605fe13cac0a3b024714722c4210346;hb=2ac486ab18adbbb84563eafc0d67fa8da6ca7822;hp=52a01d3f433785a75da57db8e856445f975c968f;hpb=0715d7b43a936dfe6696676fd6852b3f84c9eac4;p=zpackage diff --git a/t/extract.t b/t/extract.t index 52a01d3..203cc38 100755 --- a/t/extract.t +++ b/t/extract.t @@ -1,31 +1,32 @@ #!/bin/sh -# test addfile - . tap.sh -plan 5 +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" 20590a52c4f00588c500328b16d466c982a26fabaa5fa4dcc83052dd0a84f233 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 $PF $hash - | zpm-hash) +sha=$(zpm-extract -f $PF $hash - | zpm-hash) okstreq $hash $sha stdout extract hash matches finish