Add a unit test for cancel()