Skip to content

Commit 36392fe

Browse files
authored
Fix show for intervals (#155)
1 parent b975b7c commit 36392fe

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

test/runtests.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import LazyArrays: MemoryLayout, ApplyStyle, Applied, colsupport, arguments, App
4141
@test D*x QuasiOnes(x)
4242
@test D^2 * x QuasiZeros(x)
4343
@test D*[x D*x] == [D*x D^2*x]
44-
@test stringmime("text/plain", D) == "Derivative(Inclusion(-1..1))"
44+
@test stringmime("text/plain", D) == "Derivative(Inclusion($(-1..1)))"
4545
@test_throws DimensionMismatch Derivative(Inclusion(0..1)) * x
4646
end
4747
end
@@ -65,9 +65,9 @@ include("test_maps.jl")
6565
@test δ[0.0] Inf
6666
@test Base.IndexStyle(δ) Base.IndexLinear()
6767

68-
@test stringmime("text/plain", δ) == "δ at 0.0 over Inclusion(-1..3)"
68+
@test stringmime("text/plain", δ) == "δ at 0.0 over Inclusion($(-1..3))"
6969
x = Inclusion(-1..1)
70-
@test stringmime("text/plain", δ[2x .+ 1]) == "δ at 0.0 over Inclusion(-1..3) affine mapped to -1..1"
70+
@test stringmime("text/plain", δ[2x .+ 1]) == "δ at 0.0 over Inclusion($(-1..3)) affine mapped to $(-1..1)"
7171
end
7272

7373
@testset "Kernels" begin
@@ -125,4 +125,4 @@ include("test_basisconcat.jl")
125125
y = affine(0..1, x)
126126
@test plotgrid(T[y,:]) == (plotgrid(T) .+ 1)/2
127127
end
128-
end
128+
end

test/test_chebyshev.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ Base.:(==)(::FooBasis, ::FooBasis) = true
110110
@testset "Mapped" begin
111111
y = affine(0..1, x)
112112

113-
@test summary(T[y,:]) == "Chebyshev affine mapped to 0..1"
114-
@test stringmime("text/plain", T[y,:]) == "Chebyshev(5) affine mapped to 0..1"
113+
@test summary(T[y,:]) == "Chebyshev affine mapped to $(0..1)"
114+
@test stringmime("text/plain", T[y,:]) == "Chebyshev(5) affine mapped to $(0..1)"
115115
@test MemoryLayout(wT[y,:]) isa MappedWeightedBasisLayout
116116
@test MemoryLayout(w[y] .* T[y,:]) isa MappedWeightedBasisLayout
117117
@test wT[y,:][[0.1,0.2],1:5] == (w[y] .* T[y,:])[[0.1,0.2],1:5] == (w .* T[:,1:5])[y,:][[0.1,0.2],:]
@@ -186,4 +186,4 @@ Base.:(==)(::FooBasis, ::FooBasis) = true
186186
@test_throws ErrorException Chebyshev(5)'LinearSpline([-1,1])
187187
@test_throws ErrorException FooBasis()'FooBasis()
188188
end
189-
end
189+
end

test/test_maps.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ import ContinuumArrays: AffineQuasiVector
7373
end
7474

7575
@testset "show" begin
76-
@test stringmime("text/plain", y) == "2.0 * Inclusion(0..1) .+ (-1.0)"
77-
@test stringmime("text/plain", a) == "Affine map from Inclusion(-2..3) to Inclusion(-1..1)"
76+
@test stringmime("text/plain", y) == "2.0 * Inclusion($(0..1)) .+ (-1.0)"
77+
@test stringmime("text/plain", a) == "Affine map from Inclusion($(-2..3)) to Inclusion($(-1..1))"
7878
end
79-
end
79+
end

test/test_splines.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ import ContinuumArrays: basis, AdjointBasisLayout, ExpansionLayout, BasisLayout,
469469
H = HeavisideSpline([1,2,3,6])
470470
B = H[5x .+ 1,:]
471471
u = H * [1,2,3]
472-
@test stringmime("text/plain", B) == "HeavisideSpline([1, 2, 3, 6]) affine mapped to 0..1"
472+
@test stringmime("text/plain", B) == "HeavisideSpline([1, 2, 3, 6]) affine mapped to $(0..1)"
473473
end
474474

475475
@testset "A \\ ( c .* B) == c .* (A\\B) #101" begin
@@ -526,4 +526,4 @@ import ContinuumArrays: basis, AdjointBasisLayout, ExpansionLayout, BasisLayout,
526526
u = ApplyQuasiArray(*, L, randn(6,5), randn(5))
527527
@test coefficients(u) L \ u
528528
end
529-
end
529+
end

0 commit comments

Comments
 (0)