summaryrefslogtreecommitdiffstats
path: root/pid_test.go
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2015-07-10 20:18:20 +0000
committerBrian Cully <bjc@kublai.com>2015-07-10 20:18:20 +0000
commit17d71eaa18bfeb07fab78ac13b1c4fca8379a6d0 (patch)
tree8563961a34994e5862d4680dbd897d5955a3b70c /pid_test.go
parent16815048d2f7f770a454597a39838e63014132f2 (diff)
downloadgoctl-17d71eaa18bfeb07fab78ac13b1c4fca8379a6d0.tar.gz
goctl-17d71eaa18bfeb07fab78ac13b1c4fca8379a6d0.zip
Rename cmd modules.
Diffstat (limited to 'pid_test.go')
-rw-r--r--pid_test.go25
1 files changed, 25 insertions, 0 deletions
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))
+ }
+}