Skip to content

Commit

Permalink
test(CubicSpline): add tests for AbstractArray dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutosh-b-b committed Oct 13, 2024
1 parent d6a9442 commit 6330a49
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/interpolation_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,17 @@ end
@test isapprox(u_test[1, :], sin.(t_test), atol = 1e-3)
@test isapprox(u_test[2, :], cos.(t_test), atol = 1e-3)
end
@testset "AbstractArray{T, 3}" begin
f3d(t) = [sin(t) cos(t);
0. cos(2t)]
t = 0.1:0.1:1.0
u3d = f3d.(t)
c = CubicSpline(u3d, t)
t_test = 0.1:0.05:1.0
u_test = reduce(hcat, c.(t_test))
f_test = reduce(hcat, f3d.(t_test))
@test isapprox(u_test, f_test, atol = 1e-2)
end
end

@testset "BSplines" begin
Expand Down

0 comments on commit 6330a49

Please sign in to comment.