summaryrefslogtreecommitdiff
path: root/pipe_factory_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pipe_factory_test.go')
-rw-r--r--pipe_factory_test.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/pipe_factory_test.go b/pipe_factory_test.go
index f09bed31..6d3d9eeb 100644
--- a/pipe_factory_test.go
+++ b/pipe_factory_test.go
@@ -20,6 +20,33 @@ func Test_Pipe_Start(t *testing.T) {
w.Stop()
}
+func Test_Pipe_StartError(t *testing.T) {
+ cmd := exec.Command("php", "tests/client.php", "echo", "pipes")
+ cmd.Start()
+
+ w, err := NewPipeFactory().SpawnWorker(cmd)
+ assert.Error(t, err)
+ assert.Nil(t, w)
+}
+
+func Test_Pipe_PipeError(t *testing.T) {
+ cmd := exec.Command("php", "tests/client.php", "echo", "pipes")
+ cmd.StdinPipe()
+
+ w, err := NewPipeFactory().SpawnWorker(cmd)
+ assert.Error(t, err)
+ assert.Nil(t, w)
+}
+
+func Test_Pipe_PipeError2(t *testing.T) {
+ cmd := exec.Command("php", "tests/client.php", "echo", "pipes")
+ cmd.StdoutPipe()
+
+ w, err := NewPipeFactory().SpawnWorker(cmd)
+ assert.Error(t, err)
+ assert.Nil(t, w)
+}
+
func Test_Pipe_Failboot(t *testing.T) {
cmd := exec.Command("php", "tests/failboot.php")
w, err := NewPipeFactory().SpawnWorker(cmd)