Skip to content

Commit 63cc0fe

Browse files
committed
Fix tests on 1.10
1 parent 5ccc0b0 commit 63cc0fe

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

test/interpolation_tests.jl

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,13 @@ end
4343
@test A(11) == 22
4444

4545
u = vcat(2.0collect(1:10)', 3.0collect(1:10)')
46-
A = @inferred(LinearInterpolation(
47-
u, t; extrapolation = ExtrapolationType.Extension))
46+
@test @inferred(LinearInterpolation(
47+
u, t; extrapolation = ExtrapolationType.Extension)) isa LinearInterpolation broken=VERSION <
48+
v"1.11" &&
49+
t isa
50+
AbstractRange
51+
A = LinearInterpolation(
52+
u, t; extrapolation = ExtrapolationType.Extension)
4853

4954
for (_t, _u) in zip(t, eachcol(u))
5055
@test A(_t) == _u
@@ -57,8 +62,13 @@ end
5762
y = 2:4
5863
u_ = x' .* y
5964
u = [u_[:, i] for i in 1:size(u_, 2)]
60-
A = @inferred(LinearInterpolation(
61-
u, t; extrapolation = ExtrapolationType.Extension))
65+
@test @inferred(LinearInterpolation(
66+
u, t; extrapolation = ExtrapolationType.Extension)) isa LinearInterpolation broken=VERSION <
67+
v"1.11" &&
68+
t isa
69+
AbstractRange
70+
A = LinearInterpolation(
71+
u, t; extrapolation = ExtrapolationType.Extension)
6272
@test A(0) == [0.0, 0.0, 0.0]
6373
@test A(5.5) == [11.0, 16.5, 22.0]
6474
@test A(11) == [22.0, 33.0, 44.0]
@@ -260,7 +270,10 @@ end
260270

261271
# Matrix interpolation test
262272
u = [1.0 4.0 9.0 16.0; 1.0 4.0 9.0 16.0]
263-
A = @inferred(QuadraticInterpolation(u, t; extrapolation = ExtrapolationType.Extension))
273+
@test @inferred(QuadraticInterpolation(
274+
u, t; extrapolation = ExtrapolationType.Extension)) isa QuadraticInterpolation broken=VERSION <
275+
v"1.11"
276+
A = QuadraticInterpolation(u, t; extrapolation = ExtrapolationType.Extension)
264277

265278
for (_t, _u) in zip(t, eachcol(u))
266279
@test A(_t) == _u
@@ -568,7 +581,7 @@ end
568581

569582
u_ = [0.0, 1.0, 3.0]' .* ones(4)
570583
u = [u_[:, i] for i in 1:size(u_, 2)]
571-
A = @inferred(QuadraticSpline(u, t; extrapolation = ExtrapolationType.Extension))
584+
A = QuadraticSpline(u, t; extrapolation = ExtrapolationType.Extension)
572585
@test A(-2.0) == P₁(-2.0) * ones(4)
573586
@test A(-0.5) == P₁(-0.5) * ones(4)
574587
@test A(0.7) == P₁(0.7) * ones(4)
@@ -617,7 +630,9 @@ end
617630

618631
u_ = [0.0, 1.0, 3.0]' .* ones(4)
619632
u = [u_[:, i] for i in 1:size(u_, 2)]
620-
A = @inferred(CubicSpline(u, t; extrapolation = ExtrapolationType.Extension))
633+
@test @inferred(CubicSpline(u, t; extrapolation = ExtrapolationType.Extension)) isa
634+
CubicSpline broken=VERSION < v"1.11"
635+
A = CubicSpline(u, t; extrapolation = ExtrapolationType.Extension)
621636
for x in (-1.5, -0.5, -0.7)
622637
@test A(x) P₁(x) * ones(4)
623638
end

0 commit comments

Comments
 (0)