Skip to content

Commit

Permalink
Fix PkgEval test (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
nhz2 authored Sep 20, 2023
1 parent cd1eaaa commit bc9c863
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ZipArchives"
uuid = "49080126-0e18-4c2a-b176-c102e4b3760c"
authors = ["nhz2 <[email protected]>"]
version = "1.0.0"
version = "1.0.1"

[deps]
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
Expand Down
10 changes: 4 additions & 6 deletions test/external_unzippers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ Extract the zip file at zippath into the directory dirpath
Use p7zip
"""
function unzip_p7zip(zippath, dirpath)
# "LANG"=>"C.UTF-8" env variable is sometimes needed to get p7zip to use utf8
# pipe output to devnull because p7zip is noisy
p7zip_jll.p7zip() do exe
run(pipeline(`$(exe) x -y -o$(dirpath) $(zippath)`, devnull))
end
# run(addenv(`$(p7zip_jll.p7zip()) x -y -o$(dirpath) $(zippath)`, "LANG"=>"C.UTF-8"))
run(pipeline(addenv(`$(p7zip_jll.p7zip()) x -y -o$(dirpath) $(zippath)`, "LANG"=>"C.UTF-8"), devnull))
nothing
end

Expand All @@ -31,9 +31,7 @@ Extract the zip file at zippath into the directory dirpath
Use bsdtar from libarchive
"""
function unzip_bsdtar(zippath, dirpath)
LibArchive_jll.bsdtar() do exe
run(`$(exe) -x -f $(zippath) -C $(dirpath)`)
end
run(`$(LibArchive_jll.bsdtar()) -x -f $(zippath) -C $(dirpath)`)
nothing
end

Expand Down
8 changes: 6 additions & 2 deletions test/test_writer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,12 @@ include("external_unzippers.jl")
for i in 1:zip_nentries(dir)
local name = zip_name(dir, i)
local extracted_path = joinpath(tmpout, name)
@test isfile(extracted_path)
@test zip_readentry(dir, i) == read(extracted_path)
if !isfile(extracted_path)
@error "$(readdir(tmpout)) doesn't contain $(repr(name))"
@test false
else
@test zip_readentry(dir, i) == read(extracted_path)
end
end
# Check number of extracted files match
local total_files = sum(walkdir(tmpout)) do (root, dirs, files)
Expand Down

2 comments on commit bc9c863

@nhz2
Copy link
Member Author

@nhz2 nhz2 commented on bc9c863 Sep 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/91819

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.0.1 -m "<description of version>" bc9c863f8cd388a243741939047627e7113c71bc
git push origin v1.0.1

Please sign in to comment.