Skip to content

Commit

Permalink
Add a pair of working tests for zip file entries with long names
Browse files Browse the repository at this point in the history
Trrntzip currently supports entries up to the length of 1023 bytes.
A zip file with an entry of this length shall be processed correctly,
and a zip file with en entry exeeding this length (by 1 byte in the
test case) shall be rejected.

These tests will need to be revisited when the implementation limit
gets lifted.
  • Loading branch information
miller-alex committed Mar 17, 2024
1 parent b64d4ec commit 652b34b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions regress/longername.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
description torrentzip a zip with a too long entry name
return 0
arguments -l longername.zip
file longername.zip longername.zip
stderr
Could not list contents of "longername.zip". File is corrupted or contains entries with bad names.
!!!! There were problems! !!!!
end-of-inline-data
Binary file added regress/longername.zip
Binary file not shown.
11 changes: 11 additions & 0 deletions regress/longname.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description torrentzip a zip with the longest supported entry name
return 0
arguments -l longname.zip
file longname.zip longname.zip longname.tzip
stdout
Rezipping - longname.zip
--------------------------------------------------
Adding - looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongdir0/looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongdir1/looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongdir2/looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongdir3/looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongdir4/looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongdir5/looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongdir6/looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongdir7/looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongdir8/looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongdir9/test_file.txt (31 bytes)...Done
--------------------------------------------------
Rezipped 1 compressed file totaling 31 bytes.
end-of-inline-data
Binary file added regress/longname.tzip
Binary file not shown.
Binary file added regress/longname.zip
Binary file not shown.

0 comments on commit 652b34b

Please sign in to comment.