Skip to content

Commit

Permalink
Generate alias tests in a loop
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeingold committed Dec 4, 2024
1 parent 1f1a10f commit 3395102
Showing 1 changed file with 5 additions and 27 deletions.
32 changes: 5 additions & 27 deletions test/combinations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,36 +54,14 @@
end

function runtests(testable::TestableGeometry, supports::SupportStatus)
#=
for fname in ("lineintegral", "surfaceintegral", "volumeintegral")
if supports.$fname
@test $fname(testable.integrand, testable.geometry) ≈ testable.solution
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
else
@test_throws "not supported" $fname(testable.integrand, testable.geometry)
@test_throws "not supported" alias(testable.integrand, testable.geometry)
end
end
=#

# lineintegral
if supports.lineintegral
@test lineintegral(testable.integrand, testable.geometry) testable.solution
else
@test_throws "not supported" lineintegral(testable.integrand, testable.geometry)
end

# surfaceintegral
if supports.surfaceintegral
@test surfaceintegral(testable.integrand, testable.geometry) testable.solution
else
@test_throws "not supported" surfaceintegral(testable.integrand, testable.geometry)
end

# volumeintegral
if supports.volumeintegral
@test volumeintegral(testable.integrand, testable.geometry) testable.solution
else
@test_throws "not supported" volumeintegral(testable.integrand, testable.geometry)
end

if supports.gausskronrod
# Scalar integrand
Expand Down

0 comments on commit 3395102

Please sign in to comment.