Skip to content

Commit

Permalink
Change types of errors thrown
Browse files Browse the repository at this point in the history
  • Loading branch information
meggart committed Oct 21, 2024
1 parent 1968e86 commit 99960de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/test_check_size.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ds["w"][:,1:15] = ones(10,15)
@test size(ds["w"]) == (10,15)

# w cannot grow along a fixed dimension
@test_throws DimensionMismatch ds["w"][:,:] = ones(11,15)
@test_throws Union{NCDatasets.NetCDFError,DimensionMismatch} ds["w"][:, :] = ones(11, 15)

# NetCDF: Index exceeds dimension bound
@test_throws Union{NCDatasets.NetCDFError,BoundsError} ds["u"][100,100]
Expand Down
2 changes: 1 addition & 1 deletion test/test_variable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ NCDataset(filename,"c") do ds

v = defVar(ds,"small",Float64,("lon","lat"))
# @test_throws Union{NCDatasets.NetCDFError,DimensionMismatch} v[:] = zeros(sz[1]+1,sz[2])
@test_throws DimensionMismatch v[1:sz[1],1:sz[2]] = zeros(sz[1]+1,sz[2])
@test_throws Union{NCDatasets.NetCDFError,DimensionMismatch} v[1:sz[1],1:sz[2]] = zeros(sz[1]+1,sz[2])
@test_throws NCDatasets.NetCDFError v[sz[1]+1,1] = 1
@test_throws NCDatasets.NetCDFError v[-1,1] = 1

Expand Down

0 comments on commit 99960de

Please sign in to comment.