Skip to content

Commit d2904fd

Browse files
authored
Add tests for broadcasting minimum and maximum (#391)
1 parent d74f5fd commit d2904fd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/array.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,4 +418,13 @@ end
418418
end
419419
end
420420

421+
@testset "broadcast" begin
422+
testf(f, x) = Array(f(MtlArray(x))) f(x)
423+
424+
@test testf(x->max.(x, zero(Float32)), randn(Float32, 1000))
425+
@test testf(x->min.(x, one(Float32)), randn(Float32, 1000))
426+
@test testf(x->min.(max.(x, zero(Float32)), one(Float32)), randn(Float32, 1000))
427+
@test testf(x->max.(min.(x, one(Float32)), zero(Float32)), randn(Float32, 1000))
428+
end
429+
421430
end

0 commit comments

Comments
 (0)