]> pd.if.org Git - zpackage/commitdiff
make internal column function static
authorNathan Wagner <nw@hydaspes.if.org>
Fri, 12 Oct 2018 11:07:24 +0000 (11:07 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Fri, 12 Oct 2018 11:07:24 +0000 (11:07 +0000)
t/findpkg.t [new file with mode: 0755]
zpm-syncfs.c

diff --git a/t/findpkg.t b/t/findpkg.t
new file mode 100755 (executable)
index 0000000..ba8676d
--- /dev/null
@@ -0,0 +1,46 @@
+#!/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
+
index 26414e9989ceec57d413bcd136ae629702dd493f..c08407e8c455efb0aa2d0be18da794323d64e7ff 100644 (file)
@@ -163,7 +163,7 @@ static int create_leading_dirs(char *path) {
        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;