Skip to content

Commit c00518c

Browse files
Deprecate @test_approx_eq_eps (part of #4615)
1 parent 5fe253e commit c00518c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

base/test.jl

+8-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module Test
1616
export @test, @test_throws, @test_broken, @test_skip, @test_warn, @test_nowarn
1717
export @testset
1818
# Legacy approximate testing functions, yet to be included
19-
export @test_approx_eq_eps, @inferred
19+
export @inferred
2020
export detect_ambiguities
2121
export GenericString
2222

@@ -1004,6 +1004,8 @@ end
10041004
#-----------------------------------------------------------------------
10051005
# Legacy approximate testing functions, yet to be included
10061006

1007+
# BEGIN TODO: deprecated in 0.6, delete in 1.0
1008+
# vvv
10071009
approx_full(x::AbstractArray) = x
10081010
approx_full(x::Number) = x
10091011
approx_full(x) = full(x)
@@ -1050,8 +1052,11 @@ Test two floating point numbers `a` and `b` for equality taking into account
10501052
a margin of tolerance given by `tol`.
10511053
"""
10521054
macro test_approx_eq_eps(a, b, c)
1055+
Base.depwarn(string("@test_approx_eq_eps is deprecated, use `@test ", a, "", b, " atol=", c, "` instead"),
1056+
Symbol("@test_approx_eq_eps"))
10531057
:(test_approx_eq($(esc(a)), $(esc(b)), $(esc(c)), $(string(a)), $(string(b))))
10541058
end
1059+
export @test_approx_eq_eps
10551060

10561061
"""
10571062
@test_approx_eq(a, b)
@@ -1065,6 +1070,8 @@ macro test_approx_eq(a, b)
10651070
:(test_approx_eq($(esc(a)), $(esc(b)), $(string(a)), $(string(b))))
10661071
end
10671072
export @test_approx_eq
1073+
# ^^^
1074+
# END TODO
10681075

10691076
_args_and_call(args...; kwargs...) = (args[1:end-1], kwargs, args[end](args[1:end-1]...; kwargs...))
10701077
"""

0 commit comments

Comments
 (0)