File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Tests/FoundationEssentialsTests/ProgressManager Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -352,7 +352,7 @@ extension Tag {
352
352
manager. complete ( count: 2 )
353
353
}
354
354
355
- @Test func finishedChild ( ) async throws {
355
+ @Test func finishedChildUnreadBeforeDeinit ( ) async throws {
356
356
let manager = ProgressManager ( totalCount: 2 )
357
357
358
358
manager. complete ( count: 1 )
@@ -362,6 +362,20 @@ extension Tag {
362
362
#expect( manager. fractionCompleted == 1.0 )
363
363
}
364
364
365
+ @Test func finishedChildReadBeforeDeinit( ) async throws {
366
+ let manager = ProgressManager ( totalCount: 2 )
367
+
368
+ manager. complete ( count: 1 )
369
+ #expect( manager. fractionCompleted == 0.5 )
370
+
371
+ var child : ProgressManager ? = manager. subprogress ( assigningCount: 1 ) . start ( totalCount: 1 )
372
+ child? . complete ( count: 1 )
373
+ #expect( manager. fractionCompleted == 1.0 )
374
+
375
+ child = nil
376
+ #expect( manager. fractionCompleted == 1.0 )
377
+ }
378
+
365
379
@Test func uninitializedSubprogress( ) async throws {
366
380
let manager = ProgressManager ( totalCount: 2 )
367
381
You can’t perform that action at this time.
0 commit comments