From a7fd042e05eda24ecaf51e9a68302b9a3046921a Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Sun, 25 Jun 2017 11:18:46 -0700 Subject: [PATCH] add test for filtering empty iterator (#22528) --- test/iterators.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/iterators.jl b/test/iterators.jl index 5e8e368c33269c..44538ba5058bc4 100644 --- a/test/iterators.jl +++ b/test/iterators.jl @@ -406,3 +406,9 @@ end @testset "product iterator infinite loop" begin @test collect(product(1:1, (1, "2"))) == [(1, 1) (1, "2")] end + +@testset "filter empty iterable #16704" begin + arr = filter(n -> true, 1:0) + @test length(arr) == 0 + @test eltype(arr) == Int +end