Skip to content

Commit 374ec32

Browse files
committed
edit test to test deinit behavior for EstimatedTimeRemaining
1 parent cd8e010 commit 374ec32

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Tests/FoundationEssentialsTests/ProgressManager/ProgressManagerPropertiesTests.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,14 +365,18 @@ import Testing
365365
properties.estimatedTimeRemaining = Duration.seconds(200)
366366
}
367367

368-
let child = manager.subprogress(assigningCount: 1).start(totalCount: 2)
369-
child.withProperties { properties in
368+
var child: ProgressManager? = manager.subprogress(assigningCount: 1).start(totalCount: 2)
369+
child?.withProperties { properties in
370370
properties.completedCount = 1
371371
properties.estimatedTimeRemaining = Duration.seconds(80000)
372372
}
373373

374374
#expect(manager.fractionCompleted == 0.75)
375375
#expect(manager.summary(of: ProgressManager.Properties.EstimatedTimeRemaining.self) == Duration.seconds(80000))
376+
377+
child = nil
378+
#expect(manager.fractionCompleted == 1.0)
379+
#expect(manager.summary(of: ProgressManager.Properties.EstimatedTimeRemaining.self) == Duration.seconds(200))
376380
}
377381

378382
}

0 commit comments

Comments
 (0)