Skip to content

Commit 17ea2f7

Browse files
authored
tests for ProductFun (#118)
1 parent b4774a6 commit 17ea2f7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/miscAFBase.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,19 @@ Base.:(==)(a::UniqueInterval, b::UniqueInterval) = (@assert a.parentinterval ==
337337
@test (f + one(f))(x) f(x) .+ one.(f(x))
338338
end
339339
end
340+
341+
@testset "ProductFun" begin
342+
f = (x,y)->x^2 * y^3
343+
P = ProductFun(f, Chebyshev()Chebyshev())
344+
x = 0.2; y = 0.3;
345+
@test P(x, y) f(x,y)
346+
347+
# coefficients copied from P above
348+
coeffs = SVector{4}(zeros(3), [0.375, 0, 0.375], zeros(3), [0.125, 0, 0.125])
349+
fv = [Fun(Chebyshev(), c) for c in coeffs]
350+
P2 = @inferred ProductFun(fv, Chebyshev())
351+
@test P2(x, y) f(x, y)
352+
end
340353
end
341354

342355
end # module

0 commit comments

Comments
 (0)