Skip to content

Commit

Permalink
add tests for hyperslab indexing of non-scalar types
Browse files Browse the repository at this point in the history
  • Loading branch information
kleinhenz committed Aug 26, 2020
1 parent 15f4e96 commit ece0dcd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/hyperslab.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Random, Test, HDF5

@testset "hyperslab" begin
N = 10
v = [randstring(rand(5:10)) for i in 1:N, j in 1:N]

fn = tempname()
h5open(fn, "w") do f
f["data"] = v
end

h5open(fn, "r") do f
dset = f["data"]
indices = (1, 1)
@test dset[indices...] == v[indices...]

indices = (1:10, 1)
@test dset[indices...] == v[indices...]

indices = (1, 1:10)
@test dset[indices...] == v[indices...]

indices = (1:2:10, 1:3:10)
@test dset[indices...] == v[indices...]
end
end
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ include("plain.jl")
include("compound.jl")
include("custom.jl")
include("reference.jl")
include("hyperslab.jl")
include("readremote.jl")
include("extend_test.jl")
include("gc.jl")
Expand Down

0 comments on commit ece0dcd

Please sign in to comment.