         XCTAssertEqual(output.readAll(), "alpha\nbeta\n")
     }
     
-    func testPipe() {
+    func testPipe() throws {
+        let path = "/tmp/_swiftcli"
+        try FileManager.default.createDirectory(atPath: path, withIntermediateDirectories: false, attributes: nil)
+        FileManager.default.createFile(atPath: path + "/Info.plist", contents: nil, attributes: nil)
+        FileManager.default.createFile(atPath: path + "/LinuxMain.swift", contents: nil, attributes: nil)
+        FileManager.default.createFile(atPath: path + "/SwiftCLITests", contents: nil, attributes: nil)
+        defer { try! FileManager.default.removeItem(atPath: path) }
+        
         let connector = PipeStream()
         let output = PipeStream()
         
-        let ls = Task(executable: "ls", args: ["Tests"], stdout: connector)
+        let ls = Task(executable: "ls", args: [path], stdout: connector)
         let grep = Task(executable: "grep", args: ["Swift"], stdout: output, stdin: connector)
         
         ls.runAsync()

    }
    
    func testBashCapture() throws {
        let output = try capture(bash: "ls Sources")
        XCTAssertEqual(output.stdout, "SwiftCLI")
        XCTAssertEqual(output.stderr, "")
    }

        XCTAssertEqual(task3.finish(), 15)
    }
    
    func testTaskLineStream() throws {
        let path = "/tmp/_swiftcli"
        try FileManager.default.createDirectory(atPath: path, withIntermediateDirectories: false, attributes: nil)
        FileManager.default.createFile(atPath: path + "/Info.plist", contents: nil, attributes: nil)
        FileManager.default.createFile(atPath: path + "/LinuxMain.swift", contents: nil, attributes: nil)
        FileManager.default.createFile(atPath: path + "/SwiftCLITests", contents: nil, attributes: nil)
        defer { try! FileManager.default.removeItem(atPath: path) }
        
        var count = 0
        let lineStream = LineStream { (line) in
            count += 1
        }
        let task = Task(executable: "ls", args: [path], stdout: lineStream)
        XCTAssertEqual(task.runSync(), 0)
        
        lineStream.wait()
