 
 public class TestURLServer: URLProtocol
 {
-  typealias Chunks = [Chunk]
-  typealias Response = (URLRequest) -> (Chunks, HTTPURLResponse)
+  typealias Response = (URLRequest) -> ([Command], HTTPURLResponse)
   static private var testURLs: [URL: Response] = [:]
 
-  public enum Chunk
-  {
-    case data(Data), wait(TimeInterval), fail(Error)
+  public enum Command
+  {
+    case load(Data), wait(TimeInterval), fail(Error), finishLoading
   }
 
   static func register(url: URL, response: @escaping Response)

  let response = HTTPURLResponse(url: request.url!, statusCode: 200, httpVersion: nil, headerFields: headers)
  XCTAssert(data.count > 0)
  XCTAssertNotNil(response)
  return ([.data(data)], response!)
}

extension URLSessionTests

//MARK: successful download requests

let textURL = baseURL.appendingPathComponent("text")
func simpleGET(_ request: URLRequest) -> ([TestURLServer.Command], HTTPURLResponse)
{
  XCTAssert(request.url == textURL)
  let data = Data("Text with a 🔨".utf8)
