2 # Copyright (C) 2010, Parrot Foundation.
7 t/library/archive_zip.t
11 Test the Archive/Zip library
15 % prove t/library/archive_zip.t
20 .include 'test_more.pir'
22 load_bytecode 'Archive/Zip.pir'
30 $P0 = new ['Archive';'Zip']
31 $I0 = isa $P0, ['Archive';'Zip']
32 ok($I0, "new ['Archive';'Zip']")
33 $I0 = isa $P0, ['Archive';'Zip';'Base']
34 ok($I0, "is a ['Archive';'Zip';'Base']")
35 $P0 = new ['Archive';'Zip';'Member']
36 $I0 = isa $P0, ['Archive';'Zip';'Member']
37 ok($I0, "new ['Archive';'Zip';'Member']")
38 $I0 = isa $P0, ['Archive';'Zip';'Base']
39 ok($I0, "is a ['Archive';'Zip';'Base']")
40 $P0 = new ['Archive';'Zip';'FileMember']
41 $I0 = isa $P0, ['Archive';'Zip';'FileMember']
42 ok($I0, "new ['Archive';'Zip';'FileMember']")
43 $I0 = isa $P0, ['Archive';'Zip';'Member']
44 ok($I0, "is a ['Archive';'Zip';'Member']")
45 $P0 = new ['Archive';'Zip';'NewFileMember']
46 $I0 = isa $P0, ['Archive';'Zip';'NewFileMember']
47 ok($I0, "new ['Archive';'Zip';'NewFileMember']")
48 $I0 = isa $P0, ['Archive';'Zip';'FileMember']
49 ok($I0, "is a ['Archive';'Zip';'FileMember']")
53 $P0 = new ['Archive';'Zip']
54 $S0 = $P0.'pack_C'(0x12)
55 is( $S0, "\x12", "pack C (unsigned char)" )
58 $S0 = $P0.'pack_v'(0x1234)
59 is( $S0, "\x34\x12", "pack v (16bits litle endian)" )
62 $S0 = $P0.'pack_V'(0x12345678)
63 is( $S0, "\x78\x56\x34\x12", "pack V (32bits litle endian)" )
72 # vim: expandtab shiftwidth=4 ft=pir: