From cd4a067ec4b0f92fc7c47071f2f90e9514f2f927 Mon Sep 17 00:00:00 2001 From: KristofferC Date: Tue, 23 Jun 2020 15:58:53 +0200 Subject: [PATCH] add a test for #30739 --- test/compiler/codegen.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/compiler/codegen.jl b/test/compiler/codegen.jl index 254548bf6126c..f90ed2a96d815 100644 --- a/test/compiler/codegen.jl +++ b/test/compiler/codegen.jl @@ -444,3 +444,10 @@ function _handle_message_test() return _handle_progress_test(progress) end @test _handle_message_test() isa Tuple{Base.UUID, String} + +@testset "#30739" begin + ifelsetuple(n::Integer, k::Integer, f, g) = ntuple(i -> (i <= k ? f : g), n) + f(x) = x^2; g(x) = x^3; + a = [1]; b = [2] + @test ifelsetuple(5, 3, a, b) == ([1], [1], [1], [2], [2]) +end