     catch let error as URLError {
       XCTAssertEqual(error.code, .cancelled)
     }
+    catch URLSessionError.InterruptedDownload(let error, _) {
+      XCTAssertEqual(error.code, .cancelled)
+    }
 
     session.finishTasksAndInvalidate()
   }

  func testData_DoubleCancellation() throws
  {
    let deferred: Deferred<(Data, HTTPURLResponse)> = {
      let url = URL(string: "http://localhost:9973/image.jpg")!
      let session = URLSession(configuration: .default)
      defer { session.finishTasksAndInvalidate() }



  func testData_SuspendCancel() throws
  {
    let url = URL(string: "http://127.0.0.1:65521/image.jpg")!
    let session = URLSession(configuration: .default)

    let deferred = session.deferredDataTask(with: url)
