Skip to content

Commit 3bf342b

Browse files
committed
test/methods: assume correct unit in Unitful test and remove useless test
Since the commit where the assumption about the function-likeness of differentiated objects was made in step estimation, the correct unit actually works. The step with adaptive=0 was also useless, as a method with no iterations does not converge, of course.
1 parent 26431a3 commit 3bf342b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

test/methods.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,14 @@ struct NotAFunction end # not <: Function on purpose, cf #224
9999
# NOTE: the input value unit is wrong here to make this run at all!
100100
# The unit should be u"s", but it has to be the inverse of the desired output unit.
101101
# TODO: Find out the faulty code path using a debugger.
102-
twoPlaceDerivativeVal = central_fdm(5, 1)(fn, 1.0u"s/J")
103-
104-
unadaptedDerivativeVal = central_fdm(5, 1)(fn, 1.0u"s",0)
102+
twoPlaceDerivativeVal = central_fdm(5, 1)(fn, 1.0u"s")
105103

106104
adaptedDerivativeVal = central_fdm(5, 1)(fn, 1.0u"s",1)
107105

108106
@test unit(twoPlaceDerivativeVal) == u"J/s"
109-
@test unit(unadaptedDerivativeVal) == u"J/s"
110107
@test unit(adaptedDerivativeVal) == u"J/s"
111108

112109
@test isapprox(twoPlaceDerivativeVal, 5.0u"J/s"; rtol=1e-12, atol=1e-12u"J/s")
113-
@test isapprox(unadaptedDerivativeVal, 5.0u"J/s"; rtol=1e-12, atol=1e-12u"J/s")
114110
@test isapprox(adaptedDerivativeVal, 5.0u"J/s"; rtol=1e-12, atol=1e-12u"J/s")
115111
end
116112

0 commit comments

Comments
 (0)