Skip to content

Commit 31845cf

Browse files
committed
Add test using SB API
1 parent a3b981a commit 31845cf

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

lldb/test/API/lang/swift/async/taskgroups/TestSwiftTaskGroupSynthetic.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class TestCase(TestBase):
88

99
@swiftTest
10-
def test(self):
10+
def test_value_printing(self):
1111
"""Print a TaskGroup and verify its children."""
1212
self.build()
1313
lldbutil.run_to_source_breakpoint(
@@ -24,3 +24,20 @@ def test(self):
2424
"isGroupChildTask = true",
2525
],
2626
)
27+
28+
@swiftTest
29+
def test_value_api(self):
30+
"""Verify a TaskGroup contains its expected children."""
31+
self.build()
32+
_, process, _, _ = lldbutil.run_to_source_breakpoint(
33+
self, "break here", lldb.SBFileSpec("main.swift")
34+
)
35+
thread = process.GetSelectedThread()
36+
frame = thread.GetSelectedFrame()
37+
group = frame.FindVariable("group")
38+
self.assertEqual(group.num_children, 3)
39+
for task in group:
40+
self.assertEqual(str(task), str(group.GetChildMemberWithName(task.name)))
41+
self.assertEqual(
42+
task.GetChildMemberWithName("isGroupChildTask").summary, "true"
43+
)

0 commit comments

Comments
 (0)