Skip to content

Commit 45c1068

Browse files
authored
Special show for Expansions (#68)
* Special show for Expansions * Update runtests.jl * Update runtests.jl
1 parent ca07b1a commit 45c1068

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ContinuumArrays"
22
uuid = "7ae1f121-cc2c-504b-ac30-9b923412ae5c"
3-
version = "0.3.4"
3+
version = "0.3.5"
44

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"

src/bases/bases.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,14 @@ end
232232
(ST \ S) * c == (ST \ T) * d
233233
end
234234

235+
function show(io::IO, f::Expansion)
236+
P,c = arguments(f)
237+
show(io, P)
238+
print(io, " * ")
239+
show(io, c)
240+
end
241+
show(io::IO, ::MIME"text/plain", f::Expansion) = show(io, f)
242+
235243
## materialize views
236244

237245
# materialize(S::SubQuasiArray{<:Any,2,<:ApplyQuasiArray{<:Any,2,typeof(*),<:Tuple{<:Basis,<:Any}}}) =

test/runtests.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ end
151151
@test_throws BoundsError H[[0.1,2.1], 1]
152152
@test MemoryLayout(typeof(H)) == BasisLayout()
153153
@test ApplyStyle(*, typeof(H), typeof([1,2])) isa MulStyle
154+
154155
f = H*[1,2]
155156
@test f isa ApplyQuasiArray
156157
@test axes(f) == (Inclusion(1.0..3.0),)
@@ -159,6 +160,7 @@ end
159160

160161
@test @inferred(H'H) == @inferred(materialize(applied(*,H',H))) == Eye(2)
161162
@test summary(f) == "(Spline{0,Float64,Array{$Int,1}}) * (2-element Array{$Int,1})"
163+
@test stringmime("text/plain", f) == "Spline{0,Float64,Array{$Int,1}} * [1, 2]"
162164
end
163165

164166
@testset "LinearSpline" begin

0 commit comments

Comments
 (0)