Skip to content

Commit

Permalink
test: add tests for symbolic interpolation compositions
Browse files Browse the repository at this point in the history
  • Loading branch information
sathvikbhagavan committed Jul 29, 2024
1 parent a3e82f1 commit 245fe51
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ end
@testset "Symbolics" begin
u = 2.0collect(1:10)
t = 1.0collect(1:10)
A = LinearInterpolation(u, t)
A = LinearInterpolation(u, t; extrapolate = true)
B = LinearInterpolation(u .^ 2, t; extrapolate = true)
@variables t x(t)
substitute(A(t), Dict(t => x))
t_val = 2.7
@test substitute(A(t), Dict(t => t_val)) == A(t_val)
@test substitute(B(A(t)), Dict(t => t_val)) == B(A(t_val))
@test substitute(A(B(A(t))), Dict(t => t_val)) == A(B(A(t_val)))
end

@testset "Type Inference" begin
Expand Down

0 comments on commit 245fe51

Please sign in to comment.