From 1a1d12ef776b9135606273c4f0d9166434f92024 Mon Sep 17 00:00:00 2001 From: pdeffebach Date: Wed, 1 Apr 2020 09:14:50 -0400 Subject: [PATCH] tests and docs --- src/Missings.jl | 3 ++- test/runtests.jl | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Missings.jl b/src/Missings.jl index 1262947..f838b9a 100644 --- a/src/Missings.jl +++ b/src/Missings.jl @@ -213,7 +213,8 @@ passmissing(f) = PassMissing{Core.Typeof(f)}(f) skipmissings(args...) Return a tuple of iterators wrapping each of the iterators in `args`, but -skipping elements at positions where at least one of the iterators returns `missing`. +skipping elements at positions where at least one of the iterators returns `missing` +(listwise deletion of missing values). # Examples ``` diff --git a/test/runtests.jl b/test/runtests.jl index db9bb5b..bd0b6c8 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -105,7 +105,10 @@ struct CubeRooter end @test_throws MissingException mx[1] @test reduce(+, mx) === 18 @test isapprox(mapreduce(cos, *, collect(mx)), mapreduce(cos, *, mx)) - @inferred Union{Float64, Missing} mapreduce(cos, *, mx) + if VERSION >= v"1.4.0-DEV" + @inferred Union{Float64, Missing} mapreduce(cos, *, mx) + end + x = [missing missing missing] y = [1, 2, 3] mx, my = skipmissings(x, y) @@ -118,6 +121,9 @@ struct CubeRooter end mx, my = skipmissings(x, y) @test sum(mx) === 1056 @inferred Union{Missing, Int} sum(mx) + if VERSION >= v"1.4.0-DEV" + @inferred Union{Missing, Int} sum(mx) + end @test levels(1:1) == levels([1]) == levels([1, missing]) == levels([missing, 1]) == [1] @test levels(2:-1:1) == levels([2, 1]) == levels([2, missing, 1]) == [1, 2]