Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. func testTimerIsStarted() {
  2. let expectation = self.expectation(description: #function)
  3.  
  4. let timer = DispatchSource.createRepeating(interval: 0, deadline: DispatchTime.now()) {
  5. expectation.fulfill()
  6. }
  7. waitForExpectations(timeout: 0.02)
  8. }
  9.  
  10. func testTimerIsStarted() {
  11. let expectation = self.expectation(description: #function)
  12.  
  13. let timer = DispatchSource.createRepeating(interval: 0, deadline: DispatchTime.now()) {
  14. expectation.fulfill()
  15. }
  16.  
  17. withExtendedLifetime(timer) { timer in
  18. waitForExpectations(timeout: 0.02)
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement