diff --git a/test/hyperslab.jl b/test/hyperslab.jl new file mode 100644 index 000000000..6825d35a7 --- /dev/null +++ b/test/hyperslab.jl @@ -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 diff --git a/test/runtests.jl b/test/runtests.jl index 5951901c7..b4735f3d9 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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")