Skip to content

Commit 226d504

Browse files
authored
remove all summary test (#136)
1 parent 7da673c commit 226d504

File tree

3 files changed

+102
-100
lines changed

3 files changed

+102
-100
lines changed

test/interpolations.jl

Lines changed: 53 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
#ctqual = "ColorTypes."
2-
ctqual = ""
3-
# fpqual = "FixedPointNumbers."
4-
fpqual = ""
5-
61
@testset "_default_fillvalue" begin
72
@test_throws UndefVarError _default_fillvalue
83
@test typeof(ImageTransformations._default_fillvalue) <: Function
@@ -43,14 +38,15 @@ end
4338
@test typeof(ImageTransformations.box_extrapolation) <: Function
4439

4540
img = rand(Gray{N0f8}, 2, 2)
46-
n0f8_str = typestring(N0f8)
47-
matrixf64_str = typestring(Matrix{Float64})
4841

4942
for method in (Linear(), BSpline(Linear()), Constant(), BSpline(Constant()))
5043
etp = @inferred ImageTransformations.box_extrapolation(img, method=method)
5144
@test @inferred(ImageTransformations.box_extrapolation(etp)) === etp
52-
# @test summary(etp) == "2×2 extrapolate(interpolate(::Array{Gray{N0f8},2}, BSpline(Linear())), Gray{N0f8}(0.0)) with element type $(ctqual)Gray{$(fpqual)$n0f8_str}"
53-
@test typeof(etp) <: Interpolations.FilledExtrapolation
45+
@test_nowarn summary(etp)
46+
@test size(etp) == size(img)
47+
@test eltype(etp) == eltype(img)
48+
@test etp.itp isa Interpolations.BSplineInterpolation
49+
@test etp isa Interpolations.FilledExtrapolation
5450
@test etp.fillvalue === Gray{N0f8}(0.0)
5551
@test etp.itp.coefs === img
5652
end
@@ -60,54 +56,83 @@ end
6056

6157
etp = @inferred ImageTransformations.box_extrapolation(img)
6258
etp2 = @inferred ImageTransformations.box_extrapolation(etp.itp)
63-
@test summary(etp2) == "2×2 extrapolate(interpolate(::Array{Gray{N0f8},2}, BSpline(Linear())), Gray{N0f8}(0.0)) with element type $(ctqual)Gray{$(fpqual)$n0f8_str}"
64-
@test typeof(etp2) <: Interpolations.FilledExtrapolation
59+
@test_nowarn summary(etp2)
60+
@test size(etp2) == size(img)
61+
@test eltype(etp2) == eltype(img)
62+
@test etp2.itp isa Interpolations.BSplineInterpolation
63+
@test etp2 isa Interpolations.FilledExtrapolation
6564
@test etp2.fillvalue === Gray{N0f8}(0.0)
6665
@test etp2 !== etp
6766
@test etp2.itp === etp.itp
6867

6968
etp = @inferred ImageTransformations.box_extrapolation(img)
7069
etp2 = @inferred ImageTransformations.box_extrapolation(etp.itp, fillvalue=Flat())
71-
@test summary(etp2) == "2×2 extrapolate(interpolate(::Array{Gray{N0f8},2}, BSpline(Linear())), Flat()) with element type $(ctqual)Gray{$(fpqual)$n0f8_str}"
72-
@test typeof(etp2) <: Interpolations.Extrapolation
70+
@test_nowarn summary(etp2)
71+
@test size(etp2) == size(img)
72+
@test eltype(etp2) == eltype(img)
73+
@test etp2.itp isa Interpolations.BSplineInterpolation
74+
@test etp2 isa Interpolations.Extrapolation
75+
@test etp2.et == Flat()
7376
@test etp2 !== etp
7477
@test etp2.itp === etp.itp
7578

7679
etp = @inferred ImageTransformations.box_extrapolation(img, fillvalue=1)
77-
@test summary(etp) == "2×2 extrapolate(interpolate(::Array{Gray{N0f8},2}, BSpline(Linear())), Gray{N0f8}(1.0)) with element type $(ctqual)Gray{$(fpqual)$n0f8_str}"
78-
@test typeof(etp) <: Interpolations.FilledExtrapolation
80+
@test_nowarn summary(etp)
81+
@test size(etp) == size(img)
82+
@test eltype(etp) == eltype(img)
83+
@test etp.itp isa Interpolations.BSplineInterpolation
84+
@test etp isa Interpolations.FilledExtrapolation
7985
@test etp.fillvalue === Gray{N0f8}(1.0)
8086
@test etp.itp.coefs === img
8187

8288
etp = @inferred ImageTransformations.box_extrapolation(img, fillvalue=Flat())
8389
@test @inferred(ImageTransformations.box_extrapolation(etp)) === etp
84-
@test summary(etp) == "2×2 extrapolate(interpolate(::Array{Gray{N0f8},2}, BSpline(Linear())), Flat()) with element type $(ctqual)Gray{$(fpqual)$n0f8_str}"
85-
@test typeof(etp) <: Interpolations.Extrapolation
90+
@test_nowarn summary(etp)
91+
@test size(etp) == size(img)
92+
@test eltype(etp) == eltype(img)
93+
@test etp.itp isa Interpolations.BSplineInterpolation
94+
@test etp isa Interpolations.Extrapolation
95+
@test etp.et == Flat()
8696
@test etp.itp.coefs === img
8797

8898
etp = @inferred ImageTransformations.box_extrapolation(img, method=Constant())
89-
str = summary(etp)
90-
@test occursin("2×2 extrapolate(interpolate(::Array{Gray{N0f8},2}, BSpline(Constant", str) && occursin("Gray{N0f8}(0.0)) with element type $(ctqual)Gray{$(fpqual)$n0f8_str}", str)
91-
@test typeof(etp) <: Interpolations.FilledExtrapolation
99+
@test_nowarn summary(etp)
100+
@test size(etp) == size(img)
101+
@test eltype(etp) == eltype(img)
102+
@test etp.itp.it == BSpline(Constant{Nearest}())
103+
@test etp isa Interpolations.FilledExtrapolation
92104
@test etp.itp.coefs === img
93105

94106
etp = @inferred ImageTransformations.box_extrapolation(img, method=Constant(), fillvalue=Flat())
95-
str = summary(etp)
96-
@test occursin("2×2 extrapolate(interpolate(::Array{Gray{N0f8},2}, BSpline(Constant", str) && occursin("Flat()) with element type $(ctqual)Gray{$(fpqual)$n0f8_str}", str)
97-
@test typeof(etp) <: Interpolations.Extrapolation
107+
@test_nowarn summary(etp)
108+
@test size(etp) == size(img)
109+
@test eltype(etp) == eltype(img)
110+
@test etp.itp.it == BSpline(Constant{Nearest}())
111+
@test etp isa Interpolations.Extrapolation
112+
@test etp.et == Flat()
98113
@test etp.itp.coefs === img
99114

100115
imgfloat = Float64.(img)
101116
etp = @inferred ImageTransformations.box_extrapolation(imgfloat, method=Quadratic(Flat(OnGrid())))
102-
@test typeof(etp) <: Interpolations.FilledExtrapolation
103-
@test summary(etp) == "2×2 extrapolate(interpolate(OffsetArray(::$matrixf64_str, 0:3, 0:3), BSpline(Quadratic(Flat(OnGrid())))), NaN) with element type Float64"
117+
@test_nowarn summary(etp)
118+
@test size(etp) == size(imgfloat)
119+
@test eltype(etp) == eltype(imgfloat)
120+
@test etp.itp.it == BSpline(Quadratic(Flat(OnGrid())))
121+
@test etp isa Interpolations.FilledExtrapolation
104122

105123
etp = @inferred ImageTransformations.box_extrapolation(imgfloat, method=Cubic(Flat(OnGrid())), fillvalue=Flat())
106-
@test typeof(etp) <: Interpolations.Extrapolation
107-
@test summary(etp) == "2×2 extrapolate(interpolate(OffsetArray(::$matrixf64_str, 0:3, 0:3), BSpline(Cubic(Flat(OnGrid())))), Flat()) with element type Float64"
124+
@test_nowarn summary(etp)
125+
@test size(etp) == size(imgfloat)
126+
@test eltype(etp) == eltype(imgfloat)
127+
@test etp.itp.it == BSpline(Cubic(Flat(OnGrid())))
128+
@test etp isa Interpolations.Extrapolation
108129

109130
etp = @inferred ImageTransformations.box_extrapolation(imgfloat, method=Lanczos4OpenCV())
110-
@test typeof(etp) <: Interpolations.FilledExtrapolation
131+
@test_nowarn summary(etp)
132+
@test size(etp) == size(imgfloat)
133+
@test eltype(etp) == eltype(imgfloat)
134+
@test etp.itp.it == Lanczos4OpenCV()
135+
@test etp isa Interpolations.FilledExtrapolation
111136
end
112137

113138
@testset "AxisAlgorithms.A_ldiv_B_md" begin

test/runtests.jl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
using CoordinateTransformations, Rotations, TestImages, ImageCore, StaticArrays, OffsetArrays, Interpolations, LinearAlgebra
22
using Test, ReferenceTests
3+
using OffsetArrays: IdentityUnitRange # compat for Julia <1.1
34

45
refambs = detect_ambiguities(CoordinateTransformations, Base, Core)
56
using ImageTransformations
67
ambs = detect_ambiguities(ImageTransformations, CoordinateTransformations, Base, Core)
78
@test isempty(setdiff(ambs, refambs))
89

9-
function typestring(::Type{T}) where T # from https://github.com/JuliaImages/ImageCore.jl/pull/133
10-
buf = IOBuffer()
11-
show(buf, T)
12-
String(take!(buf))
13-
end
14-
1510
# helper function to compare NaN
1611
nearlysame(x, y) = x y || (isnan(x) & isnan(y))
1712
nearlysame(A::AbstractArray, B::AbstractArray) = all(map(nearlysame, A, B))

0 commit comments

Comments
 (0)