Skip to content

Commit 6e2f430

Browse files
authored
add some zero/one tests
1 parent 0df040f commit 6e2f430

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/rulesets/Base/base.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
@testset "base.jl" begin
2+
@testset "zero/one" begin
3+
for f in [zero, one]
4+
for x in [1.0, 1.0im, [10.0+im 11.0-im; 12.0+2im 13.0-3im]]
5+
test_frule(f, x)
6+
test_rrule(f, x)
7+
end
8+
end
9+
test_frule(zero, [1.0, 2.0, 3.0])
10+
test_rrule(zero, [1.0, 2.0, 3.0])
11+
end
212
@testset "copysign" begin
313
# don't go too close to zero as the numerics may jump over it yielding wrong results
414
@testset "at $y" for y in (-1.1, 0.1, 100.0)

0 commit comments

Comments
 (0)