From 491b63e0daa9103cf9471c03c4b41026f6955323 Mon Sep 17 00:00:00 2001 From: "Zen Lin(Zhinan Lin)" Date: Wed, 11 Mar 2015 21:11:15 +0800 Subject: [PATCH] Add checking trailing space for all lines of the help output Signed-off-by: Zen Lin(Zhinan Lin) --- integration-cli/docker_cli_help_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/integration-cli/docker_cli_help_test.go b/integration-cli/docker_cli_help_test.go index 4ef8b7bd9e..8fc5cd1aab 100644 --- a/integration-cli/docker_cli_help_test.go +++ b/integration-cli/docker_cli_help_test.go @@ -59,6 +59,11 @@ func TestHelpTextVerify(t *testing.T) { t.Fatalf("Line is too long(%d chars):\n%s", len(line), line) } + // All lines should not end with a space + if strings.HasSuffix(line, " ") { + t.Fatalf("Line should not end with a space: %s", line) + } + if scanForHome && strings.Contains(line, `=`+home) { t.Fatalf("Line should use '%q' instead of %q:\n%s", homedir.GetShortcutString(), home, line) } @@ -131,10 +136,11 @@ func TestHelpTextVerify(t *testing.T) { t.Fatalf("Help for %q should not end with a period: %s", cmd, line) } - // Options should not end with a space + // Options should NOT end with a space if strings.HasSuffix(line, " ") { t.Fatalf("Help for %q should not end with a space: %s", cmd, line) } + } }