summaryrefslogtreecommitdiffstats
path: root/cmd_pid_test.go
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2015-07-10 19:46:13 +0000
committerBrian Cully <bjc@kublai.com>2015-07-10 19:46:13 +0000
commitf8f30593d7df521d45fd85e1d90fb7b7fe54a980 (patch)
treeadcfb9870d3c3454a7705d1afef3102195fd6fd8 /cmd_pid_test.go
parentf38c11939e83895411dfc0d1c79bca172c56f3fc (diff)
downloadgoctl-f8f30593d7df521d45fd85e1d90fb7b7fe54a980.tar.gz
goctl-f8f30593d7df521d45fd85e1d90fb7b7fe54a980.zip
Move tests for bultin commands to separate modules.
Diffstat (limited to 'cmd_pid_test.go')
-rw-r--r--cmd_pid_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/cmd_pid_test.go b/cmd_pid_test.go
new file mode 100644
index 0000000..681b116
--- /dev/null
+++ b/cmd_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))
+ }
+}