Skip to content

Commit

Permalink
test: add tests for checking the type of vector returned
Browse files Browse the repository at this point in the history
  • Loading branch information
sathvikbhagavan committed May 31, 2024
1 parent 0467576 commit 373d920
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/interpolation_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,21 @@ end
@test_throws DataInterpolations.ExtrapolationError A(15.0)
end

@testset "Type of vector returned" begin
# Issue #253
t1 = Float32[0.1, 0.2, 0.3, 0.4, 0.5]
t2 = Float64[0.1, 0.2, 0.3, 0.4, 0.5]
interps = [
(LinearInterpolation(t1, t1), Float32),
(LinearInterpolation(t1, t2), Float32),
(LinearInterpolation(t2, t1), Float64),
(LinearInterpolation(t2, t2), Float64)
]
for i in eachindex(interps)
@test eltype(interps[i][1](t1)) == interps[i][2]
end
end

# missing values handling tests
u = [1.0, 4.0, 9.0, 16.0, 25.0, missing, missing]
t = [1.0, 2.0, 3.0, 4.0, missing, 6.0, missing]
Expand Down

0 comments on commit 373d920

Please sign in to comment.