@@ -76,59 +76,56 @@ struct SubgraphCompatibilityTests {
7676 #expect( notifiedCount == 0 )
7777 }
7878 }
79-
80- @Suite ( . disabled( if: !compatibilityTestEnabled, " Subgraph children is not implemented " ) , . graphScope)
79+
80+ @MainActor
81+ @Suite // Both ConditionTrait and GraphEnvironmentTrait's isRecursive are true
8182 struct ChildrenTests {
82-
8383 @Test
8484 func addChild( ) {
8585 let graph = Graph ( )
8686 let subgraph = Subgraph ( graph: graph)
8787 let child = Subgraph ( graph: graph)
88-
88+
8989 subgraph. addChild ( child)
9090 #expect( subgraph. childCount == 1 )
9191 #expect( subgraph. isAncestor ( of: child) == true )
92-
92+
9393 #expect( subgraph. child ( at: 0 , tag: nil ) === child)
9494
9595 #expect( child. parentCount == 1 )
9696 #expect( child. parent ( at: 0 ) === subgraph)
97-
98- #expect( 1 == 2 )
9997 }
100-
98+
10199 @Test
102100 func addChildWithTag( ) {
103101 let graph = Graph ( )
104102 let subgraph = Subgraph ( graph: graph)
105103 let child = Subgraph ( graph: graph)
106-
104+
107105 subgraph. addChild ( child, tag: 1 )
108106 #expect( subgraph. childCount == 1 )
109107 #expect( subgraph. isAncestor ( of: child) == true )
110-
108+
111109 var tag = 0
112110 #expect( subgraph. child ( at: 0 , tag: & tag) === child)
113111 #expect( tag == 1 )
114-
112+
115113 #expect( child. parentCount == 1 )
116114 #expect( child. parent ( at: 0 ) === subgraph)
117115 }
118-
116+
119117 @Test
120118 func removeChild( ) {
121119 let graph = Graph ( )
122120 let subgraph = Subgraph ( graph: graph)
123121 let child = Subgraph ( graph: graph)
124-
122+
125123 subgraph. addChild ( child)
126124 subgraph. removeChild ( child)
127125 #expect( subgraph. childCount == 0 )
128126 #expect( subgraph. isAncestor ( of: child) == false )
129-
127+
130128 #expect( child. parentCount == 0 )
131129 }
132-
133130 }
134131}
0 commit comments