Skip to content

Commit

Permalink
Additional skipmissing test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaBillson committed Aug 29, 2023
1 parent 2271445 commit b8d7b0c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,12 @@ end
# Test missingval=nothing
fraster = Raster([NaN 1.0; 2.0 NaN], (X, Y); missingval=nothing)
mraster = Raster([NaN 1.0; missing NaN], (X, Y); missingval=nothing)
iraster = Raster([1 1; missing 2], (X, Y); missingval=nothing)
nraster = Raster([1 1; missing nothing], (X, Y); missingval=nothing)
@test length(collect(skipmissing(fraster))) == 4 # Keeps NaN
@test length(collect(skipmissing(mraster))) == 3 # Drops missing
@test length(collect(skipmissing(iraster))) == 3 # Test with integers
@test length(collect(skipmissing(nraster))) == 2 # Drops nothing

# Confirm that missingvals are removed by value, even when types don't match
r = Raster(ones(Int16, 8, 8), (X,Y); missingval = Int16(-9999))
Expand Down

0 comments on commit b8d7b0c

Please sign in to comment.