Skip to content

Commit

Permalink
Try #230:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] authored Feb 8, 2022
2 parents 08ffed9 + fa92dd1 commit df23d8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/s3path.jl
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ function Base.readdir(fp::S3Path; join=false, sort=true)
sort && sort!(results)

# Return results, possibly joined with the root path if join=true
return join ? joinpath.(fp, results) : results
return join ? string.(joinpath.(fp, results)) : results
else
throw(ArgumentError("\"$fp\" is not a directory"))
end
Expand Down
8 changes: 4 additions & 4 deletions test/s3path.jl
Original file line number Diff line number Diff line change
Expand Up @@ -245,17 +245,17 @@ end
function verify_files(path::S3Path)
@test readdir(path) == ["emptydir/", "subdir1/", "test_01.txt"]
@test readdir(path; join=true) ==
[path / "emptydir/", path / "subdir1/", path / "test_01.txt"]
String[path / "emptydir/", path / "subdir1/", path / "test_01.txt"]
@test readdir(path / "emptydir/") == []
@test readdir(path / "emptydir/"; join=true) == []
@test readdir(path / "subdir1/") == ["subdir2/", "test_02.txt", "test_03.txt"]
@test readdir(path / "subdir1/"; join=true) == [
@test readdir(path / "subdir1/"; join=true) == String[
path / "subdir1/" / "subdir2/",
path / "subdir1/" / "test_02.txt",
path / "subdir1/" / "test_03.txt",
]
@test readdir(path / "subdir1/subdir2/") == ["subdir3/", "test_04.txt"]
@test readdir(path / "subdir1/subdir2/"; join=true) == [
@test readdir(path / "subdir1/subdir2/"; join=true) == String[
path / "subdir1/subdir2/" / "subdir3/", path / "subdir1/subdir2/" / "test_04.txt"
]
@test readdir(path / "subdir1/subdir2/subdir3/") == []
Expand All @@ -269,7 +269,7 @@ function verify_files(path::AbstractPath)
@test readdir(path / "emptydir/") == []
VERSION >= v"1.4.0" && @test readdir(path / "emptydir/"; join=true) == []
@test readdir(path / "subdir1/") == ["subdir2", "test_02.txt", "test_03.txt"]
VERSION >= v"1.4.0" && @test readdir(path / "subdir1/"; join=true) == [
VERSION >= v"1.4.0" && @test readdir(path / "subdir1/"; join=true) == String[
path / "subdir1" / "subdir2",
path / "subdir1" / "test_02.txt",
path / "subdir1/" / "subdir1/test_03.txt",
Expand Down

0 comments on commit df23d8b

Please sign in to comment.