diff options
author | Brian Cully <bjc@kublai.com> | 2015-07-10 20:18:20 +0000 |
---|---|---|
committer | Brian Cully <bjc@kublai.com> | 2015-07-10 20:18:20 +0000 |
commit | 17d71eaa18bfeb07fab78ac13b1c4fca8379a6d0 (patch) | |
tree | 8563961a34994e5862d4680dbd897d5955a3b70c /help_test.go | |
parent | 16815048d2f7f770a454597a39838e63014132f2 (diff) | |
download | goctl-17d71eaa18bfeb07fab78ac13b1c4fca8379a6d0.tar.gz goctl-17d71eaa18bfeb07fab78ac13b1c4fca8379a6d0.zip |
Rename cmd modules.
Diffstat (limited to 'help_test.go')
-rw-r--r-- | help_test.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/help_test.go b/help_test.go new file mode 100644 index 0000000..9c9a930 --- /dev/null +++ b/help_test.go @@ -0,0 +1,29 @@ +package goctl + +import "testing" + +func TestHelp(t *testing.T) { + gc := start(t) + defer gc.Stop() + + c := dial(t) + defer c.Close() + + buf := []byte("help") + Write(c, buf) + + buf, err := Read(c) + if err != nil { + t.Fatalf("Couldn't read from socket: %s.", err) + } + + got := string(buf) + want := `Available commands: + + help show this message + pid return the Unix process ID of this program + ping checks whether the connection is working` + if got != want { + t.Errorf("Didn't get proper help response.\nGot:\n'%s',\nWant:\n'%s'", got, want) + } +} |