Skip to content

Commit

Permalink
Add more CTS tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed Dec 17, 2017
1 parent 81eaf8c commit d0beb1c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Tests/CancellationTokenTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,21 @@ class CancellationTokenTests: XCTestCase {

wait(10)
}

func testCancellingOneFromAnother() {
let cts1 = CancellationTokenSource()
let cts2 = CancellationTokenSource()

expect { fulfil in
cts1.token.register {
cts2.cancel()
}
cts2.token.register {
fulfil()
}
}

cts1.cancel()
wait()
}
}

0 comments on commit d0beb1c

Please sign in to comment.