From 17d71eaa18bfeb07fab78ac13b1c4fca8379a6d0 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Fri, 10 Jul 2015 20:18:20 +0000 Subject: Rename cmd modules. --- pid_test.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 pid_test.go (limited to 'pid_test.go') diff --git a/pid_test.go b/pid_test.go new file mode 100644 index 0000000..681b116 --- /dev/null +++ b/pid_test.go @@ -0,0 +1,25 @@ +package goctl + +import ( + "strconv" + "testing" +) + +func TestPID(t *testing.T) { + gc := start(t) + defer gc.Stop() + + c := dial(t) + defer c.Close() + + buf := []byte("pid") + Write(c, buf) + + buf, err := Read(c) + if err != nil { + t.Fatalf("Couldn't read from socket: %s.", err) + } + if _, err = strconv.Atoi(string(buf)); err != nil { + t.Errorf("Requesting PID: got non-integer: '%s'.", string(buf)) + } +} -- cgit v1.3