File: zipinfo.test

package info (click to toggle)
android-platform-tools 29.0.6-28
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 365,224 kB
  • sloc: cpp: 1,049,638; java: 460,532; ansic: 375,452; asm: 301,257; xml: 134,509; python: 92,731; perl: 62,008; sh: 26,753; makefile: 3,210; javascript: 3,172; yacc: 1,403; lex: 455; awk: 368; ruby: 183; sql: 140
file content (53 lines) | stat: -rwxr-xr-x 1,480 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# zipinfo tests.

# Note: since "master key", Android uses libziparchive for all zip file
# handling, and that scans the whole central directory immediately. Not only
# lookups by name but also iteration is implemented using the resulting hash
# table, meaning that any test that makes assumptions about iteration order
# will fail on Android.

name: zipinfo -1
command: zipinfo -1 $FILES/example.zip | sort
expected-stdout:
	d1/
	d1/d2/a.txt
	d1/d2/b.txt
	d1/d2/c.txt
	d1/d2/dir/
	d1/d2/empty.txt
	d1/d2/x.txt
---

name: zipinfo header
command: zipinfo $FILES/example.zip | head -2
expected-stdout:
	Archive:  $FILES/example.zip
	Zip file size: 1082 bytes, number of entries: 7
---

name: zipinfo footer
command: zipinfo $FILES/example.zip | tail -1
expected-stdout:
	7 files, 1033 bytes uncompressed, 20 bytes compressed:  98.1%
---

name: zipinfo directory
# The RI doesn't use ISO dates.
command: zipinfo $FILES/example.zip d1/ | sed s/17-Jun-/2017-06-/
expected-stdout:
	drwxr-x---  3.0 unx        0 bx stor 2017-06-04 08:40 d1/
---

name: zipinfo stored
# The RI doesn't use ISO dates.
command: zipinfo $FILES/example.zip d1/d2/empty.txt | sed s/17-Jun-/2017-06-/
expected-stdout:
	-rw-r-----  3.0 unx        0 bx stor 2017-06-04 08:43 d1/d2/empty.txt
---

name: zipinfo deflated
# The RI doesn't use ISO dates.
command: zipinfo $FILES/example.zip d1/d2/x.txt | sed s/17-Jun-/2017-06-/
expected-stdout:
	-rw-r-----  3.0 unx     1024 tx defN 2017-06-04 08:45 d1/d2/x.txt
---