     }
 
     func testBackgroundExecution() {
-        func doNothing(forTimeInterval timeInterval: TimeInterval, completionHandler: @escaping () -> Void) {
-            DispatchQueue.global().asyncAfter(deadline: .now() + timeInterval) {
-                completionHandler()
-            }
-        }
-
         var value = 0
         var taskCount = 0
 

        var value = 0

        func doSomething1() -> Task<Void, Error> {
            return async {
                Thread.sleep(forTimeInterval: 1)

                guard !$0.isCancelled else {
                    return
                }

                value += 1
                $0.finish()
            }
        }


        XCTAssert(value == 5)
    }
}

// MARK: -

fileprivate func doNothing(forTimeInterval timeInterval: TimeInterval, completionHandler: @escaping () -> Void) {
    DispatchQueue.global().asyncAfter(deadline: .now() + timeInterval) {
        completionHandler()
    }
}

