summaryrefslogtreecommitdiff
path: root/pipe_factory_test.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-01-28 15:49:05 +0300
committerWolfy-J <[email protected]>2018-01-28 15:49:05 +0300
commit7e485c92cd7b745d4a0926c905e20dc68569ffbd (patch)
tree30f0355863699d2a59db8d480c28c33379542201 /pipe_factory_test.go
parent2390c945478ad2bb00ab73ea98aad50a42d64f0b (diff)
stop by worker
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)