Skip to content

Commit 746547a

Browse files
authored
Tests for operator exponents (#114)
1 parent 068510f commit 746547a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/ChebyshevTest.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,4 +257,18 @@ import ApproxFunOrthogonalPolynomials: forwardrecurrence
257257
@test f g
258258
end
259259
end
260+
261+
@testset "Operator exponentiation" begin
262+
for M in Any[Multiplication(Fun(), Chebyshev()), Multiplication(Fun())]
263+
N = @inferred (M -> M^0)(M)
264+
@test N * Fun() == Fun()
265+
N = @inferred (M -> M^1)(M)
266+
@test N == M
267+
N = @inferred (M -> M^2)(M)
268+
@test N == M*M
269+
@test M^3 == M * M * M
270+
@test M^4 == M * M * M * M
271+
@test M^10 == foldr(*, fill(M, 10))
272+
end
273+
end
260274
end

0 commit comments

Comments
 (0)