--- /dev/null
+#!/bin/sh
+
+. tap.sh
+
+plan 15
+
+PF=test.db
+
+require rm -rf tmp
+require mkdir tmp
+
+cd tmp || bailout 'can not cd to tmp'
+
+require zpm init $PF
+
+zpm newpackage -f $PF basics-1.0-1
+okexit create basics package
+
+n=$(zpm list -n -f $PF)
+okexit list package name
+okstreq "$n" "basics" package name
+
+n=$(zpm list -f $PF)
+okexit list package name
+okstreq "$n" "basics-1.0-1" package name
+
+id=$(zpm findpkg -f $PF basics)
+okexit findpkg
+okstreq "$id" "basics-1.0-1" found basics package
+
+id=$(zpm findpkg -f $PF basics-1.0)
+okexit findpkg
+okstreq "$id" "basics-1.0-1" found basics-1.0 package
+
+id=$(zpm findpkg -f $PF basics-1.0-1)
+okexit findpkg
+okstreq "$id" "basics-1.0-1" found basics-1.0-1 package
+
+id=$(zpm findpkg -f $PF basics-2.0-1)
+failsok findpkg did not find wrong version
+
+cd .. || bailout 'can not cd up'
+#rm -rf tmp
+
+finish
+
return 1;
}
-char *column(char *col, int ncols, char **vals, char **cols) {
+static char *column(char *col, int ncols, char **vals, char **cols) {
int i = 0;
char *val = NULL;