@@ -118,6 +118,35 @@ include("testutils.jl")
118118 @test CC isa Operator{ComplexF64}
119119 @test CC[1 : 4 , 1 : 4 ] ≈ C[1 : 4 , 1 : 4 ]
120120 end
121+
122+ @testset " three-term product" begin
123+ C1 = Conversion (Chebyshev (), Ultraspherical (1 ))
124+ C2 = Conversion (Ultraspherical (1 ), Ultraspherical (2 ))
125+ C = C2 * 2 * C1
126+ f = Fun (x-> 3 x^ 4 , Chebyshev ())
127+ @test space (C * f) == Ultraspherical (2 )
128+ @test C * f ≈ 2 f
129+
130+ C1 = Conversion (Chebyshev (), Ultraspherical (1 ))
131+ C2 = Conversion (Ultraspherical (1 ), Ultraspherical (2 ))
132+ C = C2 * Operator (2 I, Ultraspherical (1 )) * C1
133+ f = Fun (x-> 3 x^ 4 , Chebyshev ())
134+ @test space (C * f) == Ultraspherical (2 )
135+ @test C * f ≈ 2 f
136+
137+ M = Multiplication (Fun (), Ultraspherical (1 ))
138+ C = C2 * M * C1
139+ @test space (C * f) == Ultraspherical (2 )
140+ @test C * f ≈ Fun () * f
141+
142+ C = C2 * (M * C1)
143+ @test space (C * f) == Ultraspherical (2 )
144+ @test C * f ≈ Fun () * f
145+
146+ C = (C2 * M) * C1
147+ @test space (C * f) == Ultraspherical (2 )
148+ @test C * f ≈ Fun () * f
149+ end
121150 end
122151
123152 @testset " Normalized space" begin
0 commit comments