File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -81,16 +81,16 @@ import Testing
8181
8282 struct CustomError : Error { }
8383 struct CustomClock : Clock {
84- let _internal = TestClock ( )
85- var now : TestClock < Duration > . Instant { _internal. now }
86- var minimumResolution : TestClock < Duration > . Duration { _internal. minimumResolution }
84+ var now : ContinuousClock . Instant { fatalError ( ) }
85+ var minimumResolution : ContinuousClock . Duration { fatalError ( ) }
8786 func sleep( until deadline: Instant , tolerance: Duration ? = nil ) async throws { throw CustomError ( ) }
8887 }
8988
9089 let customClock = CustomClock ( )
90+ let testClock = TestClock ( )
9191 let task = Task {
92- try await deadline ( until: . init ( offset : . milliseconds( 200 ) ) , clock: customClock) {
93- try await customClock . sleep ( until: . init( offset: . milliseconds( 100 ) ) )
92+ try await deadline ( until: . now . advanced ( by : . milliseconds( 200 ) ) , clock: customClock) {
93+ try await testClock . sleep ( until: . init( offset: . milliseconds( 100 ) ) )
9494 }
9595 }
9696
You can’t perform that action at this time.
0 commit comments