Skip to content

Commit ab8fd36

Browse files
committed
Add a pair of tests for .zip extension check
TorrentZip should consider any file given explicitly as command line argument, regardless of extension and type. On the other hand, when processing a directory, only regular files with a .zip extension (case insensitive) and subdirectories should be considered. Add tests to check that files with different extensions are processed or ignored as expected. We can't test with symlinks, sockets, or fifos since nihtest doesn't support their creation in the sandbox.
1 parent e154eb8 commit ab8fd36

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

regress/direct.test

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
description torrentzip a file without .zip extension
2+
return 0
3+
arguments -l small.bin
4+
file small.bin small.zip small.tzip
5+
stdout
6+
Rezipping - small.bin
7+
--------------------------------------------------
8+
Adding - test.txt (31 bytes)...Done
9+
--------------------------------------------------
10+
Rezipped 1 compressed file totaling 31 bytes.
11+
end-of-inline-data

regress/recurse.test

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
description find all zip files in a directory
2+
return 0
3+
arguments -l dir
4+
file dir/CaSe.ZiP small.zip small.tzip
5+
file dir/p small.zip
6+
file dir/skip.bin small.zip
7+
file dir/sub/small.zip small.zip small.tzip
8+
stdout
9+
Rezipping - dir/CaSe.ZiP
10+
--------------------------------------------------
11+
Adding - test.txt (31 bytes)...Done
12+
--------------------------------------------------
13+
Rezipped 1 compressed file totaling 31 bytes.
14+
Rezipping - dir/sub/small.zip
15+
--------------------------------------------------
16+
Adding - test.txt (31 bytes)...Done
17+
--------------------------------------------------
18+
Rezipped 1 compressed file totaling 31 bytes.
19+
end-of-inline-data

0 commit comments

Comments
 (0)