Skip to content

Commit 37c0e65

Browse files
committed
test: additional interface tests of parametric node
1 parent 1d5ba26 commit 37c0e65

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

test/test_parametric_expression.jl

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,28 @@ end
3434
extra_metadata = (; parameters=ones(2, 5), parameter_names=["p1", "p2"]),
3535
)
3636
@test test(ExpressionInterface, ParametricExpression, [ex])
37-
@test test(NodeInterface, ParametricNode, [ex.tree])
37+
38+
x1 = ParametricNode{Float64}(; feature=1)
39+
x2 = ParametricNode{Float64}(; feature=2)
40+
41+
operators = OperatorEnum(; binary_operators=[+, *], unary_operators=[sin])
42+
43+
tree_branch_deg2 = x1 + sin(x2 * 3.5)
44+
tree_branch_deg1 = sin(x1)
45+
tree_leaf_feature = x1
46+
tree_leaf_constant = ParametricNode{Float64}(; val=1.0)
47+
48+
@test test(
49+
NodeInterface,
50+
ParametricNode,
51+
[
52+
ex.tree,
53+
tree_branch_deg2,
54+
tree_branch_deg1,
55+
tree_leaf_feature,
56+
tree_leaf_constant,
57+
],
58+
)
3859
end
3960
@testitem "Basic evaluation of parametric expressions" begin
4061
using DynamicExpressions

0 commit comments

Comments
 (0)