Skip to content

Fix show for intervals #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import LazyArrays: MemoryLayout, ApplyStyle, Applied, colsupport, arguments, App
@test D*x ≡ QuasiOnes(x)
@test D^2 * x ≡ QuasiZeros(x)
@test D*[x D*x] == [D*x D^2*x]
@test stringmime("text/plain", D) == "Derivative(Inclusion(-1..1))"
@test stringmime("text/plain", D) == "Derivative(Inclusion($(-1..1)))"
@test_throws DimensionMismatch Derivative(Inclusion(0..1)) * x
end
end
Expand All @@ -65,9 +65,9 @@ include("test_maps.jl")
@test δ[0.0] ≡ Inf
@test Base.IndexStyle(δ) ≡ Base.IndexLinear()

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

@testset "Kernels" begin
Expand Down Expand Up @@ -125,4 +125,4 @@ include("test_basisconcat.jl")
y = affine(0..1, x)
@test plotgrid(T[y,:]) == (plotgrid(T) .+ 1)/2
end
end
end
6 changes: 3 additions & 3 deletions test/test_chebyshev.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ Base.:(==)(::FooBasis, ::FooBasis) = true
@testset "Mapped" begin
y = affine(0..1, x)

@test summary(T[y,:]) == "Chebyshev affine mapped to 0..1"
@test stringmime("text/plain", T[y,:]) == "Chebyshev(5) affine mapped to 0..1"
@test summary(T[y,:]) == "Chebyshev affine mapped to $(0..1)"
@test stringmime("text/plain", T[y,:]) == "Chebyshev(5) affine mapped to $(0..1)"
@test MemoryLayout(wT[y,:]) isa MappedWeightedBasisLayout
@test MemoryLayout(w[y] .* T[y,:]) isa MappedWeightedBasisLayout
@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],:]
Expand Down Expand Up @@ -186,4 +186,4 @@ Base.:(==)(::FooBasis, ::FooBasis) = true
@test_throws ErrorException Chebyshev(5)'LinearSpline([-1,1])
@test_throws ErrorException FooBasis()'FooBasis()
end
end
end
6 changes: 3 additions & 3 deletions test/test_maps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ import ContinuumArrays: AffineQuasiVector
end

@testset "show" begin
@test stringmime("text/plain", y) == "2.0 * Inclusion(0..1) .+ (-1.0)"
@test stringmime("text/plain", a) == "Affine map from Inclusion(-2..3) to Inclusion(-1..1)"
@test stringmime("text/plain", y) == "2.0 * Inclusion($(0..1)) .+ (-1.0)"
@test stringmime("text/plain", a) == "Affine map from Inclusion($(-2..3)) to Inclusion($(-1..1))"
end
end
end
4 changes: 2 additions & 2 deletions test/test_splines.jl
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ import ContinuumArrays: basis, AdjointBasisLayout, ExpansionLayout, BasisLayout,
H = HeavisideSpline([1,2,3,6])
B = H[5x .+ 1,:]
u = H * [1,2,3]
@test stringmime("text/plain", B) == "HeavisideSpline([1, 2, 3, 6]) affine mapped to 0..1"
@test stringmime("text/plain", B) == "HeavisideSpline([1, 2, 3, 6]) affine mapped to $(0..1)"
end

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