Skip to content

Commit 0822e7a

Browse files
committed
test: add another error handling test case for tar unit test
1 parent a2915b3 commit 0822e7a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

test/util/unit/tar_test.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ CASE("Reading single entry tar file")
5151
EXPECT(name.find("CMakeLists.txt") != std::string::npos);
5252
EXPECT_NO_THROW(auto& only_element = tar.element("../CMakeLists.txt"));
5353
EXPECT_THROWS_AS(auto& missing_element = tar.element("not_there.txt"), tar::Tar_exception);
54+
55+
// try to decompress a non-tar.gz element
56+
EXPECT_THROWS_AS(tar::Tar inner_tar = r.decompress(e), tar::Tar_exception);
5457
close(fd);
5558
}
5659

0 commit comments

Comments
 (0)