]> pd.if.org Git - zpackage/blob - t/extract.t
17b2faa2da8a8f8797386a51621d48c9e7ed18be
[zpackage] / t / extract.t
1 #!/bin/sh
2
3 # test addfile
4
5 . tap.sh
6
7 plan 4
8
9 PF=test.db
10
11 rm -f $PF test.foo
12 echo foo > test.foo
13
14 hash=$(zpm-addfile $PF test.foo 2>> test.out)
15 save=$?
16
17 okexit add foo file content
18 okstreq $hash b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c foo hash contents
19
20 rm -f foo
21
22 zpm-extract $PF $hash test.foo2
23 okexit extract foo file content
24
25 sha=$(zpm-hash test.foo2)
26 okstreq $hash $sha extracted hash matches
27
28 finish
29
30 rm -f test.*