Skip to content

Commit

Permalink
test: update tests to use Val for cumulative
Browse files Browse the repository at this point in the history
  • Loading branch information
sathvikbhagavan committed Oct 1, 2023
1 parent 46a11e1 commit 4148337
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/sampled_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ using Integrals, Test
y = f.(grid)
prob = SampledIntegralProblem(y, grid)
error = solve(prob, method()).u .- exact
error_cum = solve(prob, method(); cumulative = true).u .- exact_cum[i]
error_cum = solve(prob, method(); cumulative = Val(true)).u .- exact_cum[i]
@test error < 10^-4
@test all(error_cum .< 10^-2)

# along dim=2
y = f.([grid grid]')
prob = SampledIntegralProblem(y, grid; dim = 2)
error = solve(prob, method()).u .- exact
error_cum = solve(prob, method(); cumulative = true).u .-
error_cum = solve(prob, method(); cumulative = Val(true)).u .-
[exact_cum[i] exact_cum[i]]'
@test all(error .< 10^-4)
@test all(error_cum .< 10^-2)
Expand Down Expand Up @@ -75,9 +75,9 @@ end
@test sol2 == solve(SampledIntegralProblem(y, x, dim = 1), alg; cumulative)
end
@testset "Total Integral" begin
test_interface(x, y, false)
test_interface(x, y, Val(false))
end
@testset "Cumulative Integral" begin
test_interface(x, y, true)
test_interface(x, y, Val(true))
end
end

0 comments on commit 4148337

Please sign in to comment.