diff --git a/test/Project.toml b/test/Project.toml index 14770df..8622d7d 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -4,11 +4,11 @@ Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193" LibArchive_jll = "1e303b3e-d4db-56ce-88c4-91e52606a1a8" Mmap = "a63ad114-7e13-5084-954f-fe012c677804" -MutatePlainDataArray = "3b0f367b-da20-4531-811a-c13cc92422b5" OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" TranscodingStreams = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" ZipArchives = "49080126-0e18-4c2a-b176-c102e4b3760c" diff --git a/test/test_reader.jl b/test/test_reader.jl index 3ff0dca..8ed588a 100644 --- a/test/test_reader.jl +++ b/test/test_reader.jl @@ -1,7 +1,7 @@ include("common.jl") using Pkg.Artifacts: @artifact_str, ensure_artifact_installed using Base64: base64decode -using MutatePlainDataArray: aref +using Setfield: @set using p7zip_jll: p7zip_jll @testset "find_end_of_central_directory_record unit tests" begin @@ -253,17 +253,18 @@ end # now try with a bad uncompressed_size r = ZipBufferReader(read(joinpath(artifact"fixture", "fixture", "ubuntu22-7zip.zip"))) - aref(r.entries)[1].uncompressed_size[] = 2 + correct_entry = r.entries[1] + r.entries[1] = @set(correct_entry.uncompressed_size = 2) @test_throws ArgumentError zip_test_entry(r, 1) @test_throws ArgumentError zip_readentry(r, 1) # now try with a bad uncompressed_size r = ZipBufferReader(read(joinpath(artifact"fixture", "fixture", "ubuntu22-7zip.zip"))) - aref(r.entries)[1].uncompressed_size[] = typemax(Int64)-1 + r.entries[1] = @set(correct_entry.uncompressed_size = typemax(Int64)-1) @test_throws ArgumentError zip_test_entry(r, 1) # @test_throws OutOfMemoryError zip_readentry(r, 1) - aref(r.entries)[1].uncompressed_size[] = 1<<30 + r.entries[1] = @set(correct_entry.uncompressed_size = 1<<30) @test_throws ArgumentError zip_test_entry(r, 1) @test_throws ArgumentError zip_readentry(r, 1)