Skip to content

Commit

Permalink
test(BSplines): add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutosh-b-b committed Oct 26, 2024
1 parent 315dc9d commit e71c552
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/interpolation_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,20 @@ end
@test_throws DataInterpolations.ExtrapolationError A(-1.0)
@test_throws DataInterpolations.ExtrapolationError A(300.0)

@testset "Vector{Vector}" begin end
@testset "Vector{Vector}" begin
t = 0.1:0.1:1.0
u_vec = [[sin.(t_), cos.(t_)] for t_ in t]
A = BSplineInterpolation(u_vec, t, 2, :Uniform, :Uniform)
t_test = 0.1:0.05:1.0
u_test = reduce(hcat, A.(t_test))
@test isapprox(u_test[1, :], sin.(t_test), atol = 1e-3)
@test isapprox(u_test[2, :], cos.(t_test), atol = 1e-3)

A = BSplineInterpolation(u_vec, t, 2, :ArcLen, :Average)
u_test = reduce(hcat, A.(t_test))
@test isapprox(u_test[1, :], sin.(t_test), atol = 1e-2)
@test isapprox(u_test[2, :], cos.(t_test), atol = 1e-2)
end

@testset "AbstractMatrix" begin
t = 0.1:0.1:1.0
Expand Down

0 comments on commit e71c552

Please sign in to comment.