Skip to content

Commit a08202c

Browse files
committed
test: ensure all node interface branches tested
1 parent a698636 commit a08202c

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

test/test_node_interface.jl

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,21 @@
66
x1 = Node{Float64}(; feature=1)
77
x2 = Node{Float64}(; feature=2)
88

9-
operators = OperatorEnum(; binary_operators=[+, *])
9+
operators = OperatorEnum(; binary_operators=[+, *], unary_operators=[sin])
1010

11-
tree_branch = x1 + x2 * 3.5
11+
tree_branch_deg2 = x1 + sin(x2 * 3.5)
12+
tree_branch_deg1 = sin(x1)
1213
tree_leaf = x1
13-
graph_tree_branch = convert(GraphNode, tree_branch)
14+
graph_tree_branch_deg2 = convert(GraphNode, tree_branch_deg2)
15+
graph_tree_branch_deg1 = convert(GraphNode, tree_branch_deg1)
1416
graph_tree_leaf = convert(GraphNode, tree_leaf)
1517

16-
@test Interfaces.test(NodeInterface, Node, [tree_branch, tree_leaf])
17-
@test Interfaces.test(NodeInterface, GraphNode, [graph_tree_branch, graph_tree_leaf])
18+
@test Interfaces.test(
19+
NodeInterface, Node, [tree_branch_deg2, tree_branch_deg1, tree_leaf]
20+
)
21+
@test Interfaces.test(
22+
NodeInterface,
23+
GraphNode,
24+
[graph_tree_branch_deg2, graph_tree_branch_deg1, graph_tree_leaf],
25+
)
1826
end

0 commit comments

Comments
 (0)