Skip to content

Commit

Permalink
Add a pair of tests for .zip extension check
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
miller-alex committed Mar 22, 2024
1 parent e154eb8 commit ab8fd36
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
11 changes: 11 additions & 0 deletions regress/direct.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description torrentzip a file without .zip extension
return 0
arguments -l small.bin
file small.bin small.zip small.tzip
stdout
Rezipping - small.bin
--------------------------------------------------
Adding - test.txt (31 bytes)...Done
--------------------------------------------------
Rezipped 1 compressed file totaling 31 bytes.
end-of-inline-data
19 changes: 19 additions & 0 deletions regress/recurse.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
description find all zip files in a directory
return 0
arguments -l dir
file dir/CaSe.ZiP small.zip small.tzip
file dir/p small.zip
file dir/skip.bin small.zip
file dir/sub/small.zip small.zip small.tzip
stdout
Rezipping - dir/CaSe.ZiP
--------------------------------------------------
Adding - test.txt (31 bytes)...Done
--------------------------------------------------
Rezipped 1 compressed file totaling 31 bytes.
Rezipping - dir/sub/small.zip
--------------------------------------------------
Adding - test.txt (31 bytes)...Done
--------------------------------------------------
Rezipped 1 compressed file totaling 31 bytes.
end-of-inline-data

0 comments on commit ab8fd36

Please sign in to comment.