Skip to content

Commit c4204e3

Browse files
authored
Move function definition out of testset (#695)
1 parent 026f3d9 commit c4204e3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/runtests.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ macro test_or_throws(extype, ex)
5555
)
5656
end
5757

58+
is_finite_nonzero(x) = isfinite(x) && !iszero(x)
59+
5860
@testset "Construction" begin
5961
@test isa(NoUnits, FreeUnits)
6062
@test typeof(𝐋) === Unitful.Dimensions{(Unitful.Dimension{:Length}(1),)}
@@ -225,7 +227,6 @@ end
225227
# return NaN, Inf, or 0 in these cases, i.e. either returns a finite
226228
# result or throws an error indicating that it cannot handle the
227229
# conversion.
228-
is_finite_nonzero(x) = isfinite(x) && !iszero(x)
229230
@test_or_throws ArgumentError is_finite_nonzero(uconvert(u"kb^12", 1u"b^12"))
230231
@test_or_throws ArgumentError is_finite_nonzero(uconvert(u"ab^11", 1u"Tb^11"))
231232
@test_or_throws ArgumentError is_finite_nonzero(uconvert(u"Tb^11", 1u"ab^11"))

0 commit comments

Comments
 (0)