@@ -337,6 +337,11 @@ extension Tag {
337
337
#expect( manager. fractionCompleted == Double ( 2 ) / Double( 3 ) )
338
338
}
339
339
340
+ func makeFinishedChild( subprogress: consuming Subprogress ) async {
341
+ let manager = subprogress. start ( totalCount: 2 )
342
+ manager. complete ( count: 2 )
343
+ }
344
+
340
345
@Test func unfinishedChild( ) async throws {
341
346
let manager = ProgressManager ( totalCount: 2 )
342
347
@@ -347,9 +352,24 @@ extension Tag {
347
352
#expect( manager. fractionCompleted == 1.0 )
348
353
}
349
354
350
- func makeFinishedChild( subprogress: consuming Subprogress ) async {
351
- let manager = subprogress. start ( totalCount: 2 )
352
- manager. complete ( count: 2 )
355
+ @Test func unfinishedGrandchild( ) async throws {
356
+ let manager = ProgressManager ( totalCount: 1 )
357
+
358
+ let child = manager. subprogress ( assigningCount: 1 ) . start ( totalCount: 1 )
359
+
360
+ await makeUnfinishedChild ( subprogress: child. subprogress ( assigningCount: 1 ) )
361
+ #expect( manager. fractionCompleted == 1.0 )
362
+ }
363
+
364
+ @Test func unfinishedGreatGrandchild( ) async throws {
365
+ let manager = ProgressManager ( totalCount: 1 )
366
+
367
+ let child = manager. subprogress ( assigningCount: 1 ) . start ( totalCount: 1 )
368
+
369
+ let grandchild = child. subprogress ( assigningCount: 1 ) . start ( totalCount: 1 )
370
+
371
+ await makeUnfinishedChild ( subprogress: grandchild. subprogress ( assigningCount: 1 ) )
372
+ #expect( manager. fractionCompleted == 1.0 )
353
373
}
354
374
355
375
@Test func finishedChildUnreadBeforeDeinit( ) async throws {
0 commit comments