From 4f1dc01cc1cecac408d90217874e7a2f5caa698a Mon Sep 17 00:00:00 2001 From: Nathan Wagner Date: Mon, 17 Sep 2018 11:35:16 +0000 Subject: [PATCH] change test scripts to init a new zpm db --- t/addfile.t | 9 ++++++--- t/extract.t | 9 +++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/t/addfile.t b/t/addfile.t index 4a7de4f..4b8e093 100755 --- a/t/addfile.t +++ b/t/addfile.t @@ -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 diff --git a/t/extract.t b/t/extract.t index 52a01d3..d526b4c 100755 --- a/t/extract.t +++ b/t/extract.t @@ -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 -- 2.40.0