Skip to content

Commit

Permalink
Add rtol kwarg to runtests
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeingold committed Dec 5, 2024
1 parent 4b9157e commit 2d6a6ea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/combinations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@
end
end

function runtests(testable::TestableGeometry, supports::SupportStatus)
function runtests(testable::TestableGeometry, supports::SupportStatus; rtol=sqrt(eps()))
# Test alias functions
for alias in (lineintegral, surfaceintegral, volumeintegral)
alias_symbol = first(methods(alias)).name
if getfield(supports, alias_symbol)
@test alias(testable.integrand, testable.geometry) testable.solution
@test alias(testable.integrand, testable.geometry) testable.solution rtol=rtol
else
@test_throws "not supported" alias(testable.integrand, testable.geometry)
end
Expand All @@ -75,16 +75,16 @@
if supported
# Scalar integrand
sol = testable.solution
@test integral(testable.integrand, testable.geometry, rule) sol
@test integral(testable.integrand, testable.geometry, rule) sol rtol=rtol

# Callable integrand
f = Callable(testable.integrand)
@test integral(f, testable.geometry, rule) sol
@test integral(f, testable.geometry, rule) sol rtol=rtol

# Vector integrand
fv(p) = fill(testable.integrand(p), 3)
sol_v = fill(testable.solution, 3)
@test integral(fv, testable.geometry, rule) sol_v
@test integral(fv, testable.geometry, rule) sol_v rtol=rtol
else
@test_throws "not supported" integral(testable.integrand, testable.geometry, rule)
end # if
Expand Down

0 comments on commit 2d6a6ea

Please sign in to comment.