]> pd.if.org Git - zpackage/blob - t/addfile.t
use lzma from xz 5.2.4
[zpackage] / t / addfile.t
1 #!/bin/sh
2
3 # test addfile
4
5 . tap.sh
6
7 plan 6
8
9 PF=test.db
10
11 rm -f $PF test.empty
12 touch test.empty
13
14 hash=$(zpm-addfile $PF test.empty 2>> test.out)
15 okexit add empty file content
16 okstreq $hash e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 hash contents
17
18 appid=$(sqlite3 test.db 'pragma application_id')
19 okstreq $appid 1515209794 application id set
20
21 userv=$(sqlite3 test.db 'pragma user_version')
22 okstreq $userv 1 db version set
23
24 mkdir test.dir
25 zpm-addfile $PF test.dir 2>>test.out
26 failsok fail to add directory
27 rmdir test.dir
28
29 zpm-addfile $PF /dev/null 2>>test.out
30 failsok fail to device file
31
32 finish
33
34 rm -f $PF test.empty