diff --git a/test/test_multifile.jl b/test/test_multifile.jl index 40cd20a4..160b363e 100644 --- a/test/test_multifile.jl +++ b/test/test_multifile.jl @@ -59,6 +59,9 @@ function example_file(i,array, fname = tempname(); #nclon[:] = 1:size(array,1) #nclat[:] = 1:size(array,2) nctime.var[:] = i + + nclon[:] = 1:size(array,1) + nclat[:] = 1:size(array,2) end return fname end @@ -147,13 +150,22 @@ for deferopen in (false,true) write(fname_merged,mfds) ds_merged = NCDataset(fname_merged) - @test mfds.dim["time"] == size(C,3) + @test mfds.dim["time"] == size(C,3) + @test mfds["time"][:] == ds_merged["time"][:] + @test mfds["lon"][:] == ds_merged["lon"][:] @test name(mfds[CF"time"]) == "time" - close(ds_merged) + # save subset of aggregated file + fname_merged = tempname() + write(fname_merged,mfds,idimensions = Dict("lon" => 1:1)) + + ds_merged = NCDataset(fname_merged) + @test mfds["lon"][1:1] == ds_merged["lon"][:] + close(ds_merged) + # show buf = IOBuffer() show(buf,mfds)