]> pd.if.org Git - zpackage/commitdiff
add test script for addtopackage
authorNathan Wagner <nw@hydaspes.if.org>
Wed, 28 Sep 2016 00:46:13 +0000 (00:46 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Wed, 28 Sep 2016 00:46:13 +0000 (00:46 +0000)
t/addtopackage.t [new file with mode: 0755]

diff --git a/t/addtopackage.t b/t/addtopackage.t
new file mode 100755 (executable)
index 0000000..a0ef944
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# test addfile
+
+#printf "# PATH=%s\n" "$PATH" 1>&2
+. tap.sh
+
+PF=test.db
+
+plan 7
+
+td=test.addtopackage
+rm -rf $td
+mkdir $td
+echo foo > $td/foo
+
+tryrun zpm addtopackage zpmtest $td/foo
+h=$(zpm hash $td/foo)
+tryrun zpm extract zpmtest-1.0-1.zpm $h $td/foo2
+h2=$(zpm hash $td/foo2)
+okstreq "$h" "$h2"
+pkglist=$(zpm showpkg zpmtest-1.0-1.zpm)
+set $pkglist
+okstreq "$1" "zpmtest"
+okstreq "$2" "1.0"
+okstreq "$3" "1"
+okstreq "$4" "$td/foo"
+
+finish
+
+rm -rf $td