From ecdae4155e038a3e3b656dcb1b56591074074ca8 Mon Sep 17 00:00:00 2001 From: Erica Marigold Date: Wed, 8 Jan 2025 14:22:46 +0000 Subject: [PATCH] chore(tests): add case for garbage after comment --- tests/edge_cases.luau | 7 +++++++ tests/extract.luau | 4 +--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/edge_cases.luau b/tests/edge_cases.luau index 0e04682..66a4d1b 100644 --- a/tests/edge_cases.luau +++ b/tests/edge_cases.luau @@ -16,6 +16,13 @@ return function(test: typeof(frktest.test)) check.equal(zip.comment, "short.") end) + test.case("Handles comment with garbage after properly", function() + local data = fs.readFile("tests/data/comment_garbage.zip") + local zip = ZipReader.load(buffer.fromstring(data)) + + check.equal(zip.comment, "short.") + end) + test.case("Follows symlinks correctly", function() -- TODO: More test files with symlinks diff --git a/tests/extract.luau b/tests/extract.luau index 913cddb..b6fa02a 100644 --- a/tests/extract.luau +++ b/tests/extract.luau @@ -14,9 +14,7 @@ local FALLIBLES = { -- "invalid_cde_number_of_files_allocation_smaller_offset.zip", "invalid_offset.zip", "invalid_offset2.zip", - -- FIXME: Does not error when it should - -- "comment_garbage.zip", - "chinese.zip", + "chinese.zip", -- TODO: Support UTF8 data in file names "non_utf8.zip", -- FIXME: Lune breaks for non utf8 data in process stdout "pandoc_soft_links.zip", -- Soft links are tested separately in edge_cases }