Skip to content

Commit 81b5132

Browse files
committed
test/methods: do the (still broken) Unitful test with floats and not integers (although both work)
Again, the input value x to fn needs to have non-sensible units for the desired units to come out of the finite difference method.
1 parent a902f0f commit 81b5132

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/methods.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ struct NotAFunction end # not <: Function on purpose, cf #224
9191

9292
# Integration test to ensure that Unitful-output functions can be tested.
9393
@testset "Unitful output" begin
94-
fn(x) = 5u"J/s" * x
95-
@show derivativeVal = central_fdm(5, 1)(fn, 1u"s/J")
94+
fn(x) = 5.0u"J/s" * x
95+
@show derivativeVal = central_fdm(5, 1)(fn, 1.0u"s/J")
9696
@test unit(derivativeVal) == u"J/s"
97-
@test isapprox(derivativeVal, 5u"J/s"; rtol=1e-12, atol=1e-12u"J/s")
97+
@test isapprox(derivativeVal, 5.0u"J/s"; rtol=1e-12, atol=1e-12u"J/s")
9898
end
9999

100100
@testset "Adaptation improves estimate" begin

0 commit comments

Comments
 (0)