]> pd.if.org Git - zpackage/commitdiff
change test scripts to init a new zpm db
authorNathan Wagner <nw@hydaspes.if.org>
Mon, 17 Sep 2018 11:35:16 +0000 (11:35 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Mon, 24 Sep 2018 10:40:18 +0000 (10:40 +0000)
t/addfile.t
t/extract.t

index 4a7de4f38405cf686b47e847ce9f09290c87ab7b..4b8e0932c0bce75b517b9de3f5db56e4c173b3e7 100755 (executable)
@@ -4,16 +4,19 @@
 
 . tap.sh
 
-plan 6
+plan 7
 
 PF=test.db
 
 rm -f $PF test.empty
 touch test.empty
 
-hash=$(zpm-addfile $PF test.empty 2>> test.out)
+zpm init $PF
+okexit create addfile test db
+
+hash=$(zpm addfile $PF test.empty 2>> test.out)
 okexit add empty file content
-okstreq $hash e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 hash contents
+okstreq "$hash" e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 hash contents
 
 appid=$(sqlite3 test.db 'pragma application_id')
 okstreq $appid 1515209794 application id set
index 52a01d3f433785a75da57db8e856445f975c968f..d526b4cdea31d4805d94e9a0c5a394c31fb19bec 100755 (executable)
@@ -1,21 +1,22 @@
 #!/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" b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c foo hash contents
 
 rm -f foo