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. --- help_test.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 help_test.go (limited to 'help_test.go') 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) + } +} -- cgit v1.2.3