Skip to content

Commit 28c99d9

Browse files
committed
Add compatibility tests for tree
1 parent a403e04 commit 28c99d9

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

Tests/OpenAttributeGraphCompatibilityTests/Graph/SubgraphCompatibilityTests.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,11 @@ struct SubgraphCompatibilityTests {
128128
#expect(child.parentCount == 0)
129129
}
130130
}
131+
132+
@Test
133+
func treeRoot() {
134+
let graph = Graph()
135+
let subgraph = Subgraph(graph: graph)
136+
let _ = subgraph.treeRoot
137+
}
131138
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
//
2+
// TreeCompatibilityTests.swift
3+
// OpenAttributeGraphCompatibilityTests
4+
5+
import Testing
6+
7+
@MainActor
8+
@Suite(.graphScope)
9+
struct TreeCompatibilityTests {
10+
11+
@Test
12+
func treeElement() {
13+
let graph = Graph()
14+
let subgraph = Subgraph(graph: graph)
15+
16+
let treeElement = subgraph.treeRoot
17+
#expect(treeElement == nil)
18+
19+
let _ = treeElement?.type
20+
let _ = treeElement?.value
21+
let _ = treeElement?.flags
22+
let _ = treeElement?.parent
23+
}
24+
25+
@Test
26+
func values() {
27+
let graph = Graph()
28+
let subgraph = Subgraph(graph: graph)
29+
30+
let treeElement = subgraph.treeRoot
31+
var values = treeElement?.values
32+
33+
let treeValue = values?.next()
34+
let _ = treeValue?.type
35+
let _ = treeValue?.value
36+
let _ = treeValue?.key
37+
let _ = treeValue?.flags
38+
}
39+
40+
@Test
41+
func nodes() {
42+
let graph = Graph()
43+
let subgraph = Subgraph(graph: graph)
44+
45+
let treeElement = subgraph.treeRoot
46+
var nodes = treeElement?.nodes
47+
48+
let _ = nodes?.next()
49+
}
50+
51+
@Test
52+
func children() {
53+
let graph = Graph()
54+
let subgraph = Subgraph(graph: graph)
55+
56+
let treeElement = subgraph.treeRoot
57+
var children = treeElement?.children
58+
59+
let _ = children?.next()
60+
}
61+
}

0 commit comments

Comments
 (0)