X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=t%2Fadd.t;h=53a15d56ddce4bde37f924607fa4ddaa1eeee70e;hb=d6aefd8ebda828ed4c9fef447f96882c1db52ce1;hp=244321887fbcea9c032de71f530f1803a5af2fc4;hpb=22da8d52b3a8a7556b81c3e921d5c4555b76b799;p=zpackage diff --git a/t/add.t b/t/add.t index 2443218..53a15d5 100755 --- a/t/add.t +++ b/t/add.t @@ -7,7 +7,7 @@ PF=test.db -plan 32 +plan 34 require rm -rf tmp require mkdir tmp @@ -19,10 +19,11 @@ okexit 'making foo' pkgid=zpmtest-1.0-1 PF=zpmtest-1.0-1.zpm -require zpm newpackage -C $pkgid -require zpm add $pkgid foo +require -v zpm newpackage -C $pkgid +require -v zpm add -vvv -f $PF -p $pkgid foo h=$(zpm hash foo) -require zpm extract zpmtest-1.0-1.zpm $h foo2 +diag "hash $h" +require -v zpm extract -f zpmtest-1.0-1.zpm $h foo2 h2=$(zpm hash foo2) okstreq "$h" "$h2" "foo and foo2 hash match" @@ -36,9 +37,9 @@ diag "$pkglist" rm -f $PF require zpm newpackage -f $PF -C $pkgid -require zpm add -f $PF zpmtest foo +require zpm add -f $PF -p zpmtest foo rm -f foo2 -require zpm extract $PF $h foo2 +require zpm extract -f $PF $h foo2 h2=$(zpm hash foo2) okstreq "$h" "$h2" @@ -54,19 +55,19 @@ rm -f $PF mkdir subdir touch subdir/foo require zpm newpackage -f $PF -C $pkgid -require zpm add -f $PF -S subdir zpmtest subdir/foo +require -v zpm add -f $PF -S subdir -p zpmtest subdir/foo fn=$(zpm showpkg $PF | awk '{print $4}') okstreq "$fn" "/foo" file foo in package prefix striped rm -f $PF require zpm newpackage -f $PF -C $pkgid -require zpm add -f $PF zpmtest foo +require zpm add -f $PF -p zpmtest foo ph=$(zpm pkg -f $PF zpmtest hash) okstreq "$ph" "" package hash empty mtime=$(zpm pkg -f $PF zpmtest build_time) okstreq "$ph" "" package mtime empty -zpm add -C -f $PF zpmtest subdir/foo +zpm add -C -f $PF -p zpmtest subdir/foo okexit added file and completed package ph=$(zpm pkg -f $PF zpmtest hash) test -n "$ph" @@ -77,12 +78,16 @@ test -n "$mtime" okexit package mtime not empty touch subdir/bar -require zpm add -f $PF zpmtest subdir/bar +require zpm add -f $PF -p zpmtest subdir/bar ph=$(zpm pkg -f $PF zpmtest hash) okstreq "$ph" "" package hash cleared mtime=$(zpm pkg -f $PF zpmtest build_time) okstreq "$ph" "" package mtime cleared +echo junk data > subdir/baz +require zpm add -f $PF subdir/baz +rm $PF +require zpm add -i -f $PF subdir/baz finish