Keno / SIUnits.jl

Efficient unit-checked computation
Other
70 stars 26 forks source link

Support @test_approx_eq #33

Open mbauman opened 10 years ago

mbauman commented 10 years ago

Right now,

julia> @Base.Test.test_approx_eq 1.0s 1.0s
ERROR: `isless` has no method matching isless(::Float64, ::SIQuantity{Float64,0,0,1,0,0,0,0})
 in test_approx_eq at test.jl:107
 in test_approx_eq at test.jl:119

This is because Base.Test strips the units in:

array_eps(a) = eps(float(maximum(x->(isfinite(x) ? abs(x) : nan(x)), a)))

I'm not sure what the best course of action is. The simplest is to define our own Base.Test.array_eps method. But that seems messy.

PythonNut commented 9 years ago

I suppose this could be partly resolved if #14 preserves units.