Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maxfreu committed Oct 19, 2023
1 parent e0219e2 commit 54d7a2e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/sources/gdal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ gdalpath = maybedownload(url)
@test size(trimmed) == (414, 514)
cropped = Rasters.crop(a; to=trimmed)
@test size(cropped) == (414, 514)
kwcropped = Rasters.crop(a; to=trimmed, dims=(X,))
@test size(kwcropped) == (414, 515) # mind the 1px difference here, only cropped along x
@test all(collect(cropped .=== trimmed))
extended = extend(cropped; to=a)
@test all(collect(extended .=== a))
Expand Down
2 changes: 2 additions & 0 deletions test/sources/grd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ grdpath = stem * ".gri"
@test size(trimmed) == (81, 77, 3)
cropped = crop(a; to=trimmed)
@test size(cropped) == (81, 77, 3)
kwcropped = crop(a; to=trimmed, dims=(X,))
@test size(kwcropped) == (81, size(a,Y), 3)
@test all(collect(cropped .== trimmed))
extended = extend(cropped; to=a);
@test all(collect(extended .== a))
Expand Down
2 changes: 2 additions & 0 deletions test/sources/ncdatasets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ end
@test size(trimmed) == (160, 169, 24)
cropped = crop(a; to=trimmed)
@test size(cropped) == (160, 169, 24)
kwcropped = crop(a; to=trimmed, dims=(X,))
@test size(kwcropped) == (160, size(a,Y), 24)
@test all(collect(cropped .=== trimmed))
extended = extend(cropped; to=a)
@test all(collect(extended .=== a))
Expand Down

0 comments on commit 54d7a2e

Please sign in to comment.