From e5d08cf47d1f37022d8995fbdbabe2edd528333e Mon Sep 17 00:00:00 2001 From: Frank Schroeder Date: Tue, 17 Oct 2017 14:07:30 +0200 Subject: [PATCH] commands: add missing noTabs test --- command/lock/lock_test.go | 7 +++++++ command/maint/maint_test.go | 7 +++++++ command/members/members_test.go | 7 +++++++ command/watch/watch_test.go | 7 +++++++ 4 files changed, 28 insertions(+) diff --git a/command/lock/lock_test.go b/command/lock/lock_test.go index 41e6a92170..b7faa48276 100644 --- a/command/lock/lock_test.go +++ b/command/lock/lock_test.go @@ -25,6 +25,13 @@ func argFail(t *testing.T, args []string, expected string) { } +func TestLockCommand_noTabs(t *testing.T) { + t.Parallel() + if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') { + t.Fatal("usage has tabs") + } +} + func TestLockCommand_BadArgs(t *testing.T) { t.Parallel() argFail(t, []string{"-try=blah", "test/prefix", "date"}, "invalid duration") diff --git a/command/maint/maint_test.go b/command/maint/maint_test.go index 0403976559..6daa9b4ab5 100644 --- a/command/maint/maint_test.go +++ b/command/maint/maint_test.go @@ -9,6 +9,13 @@ import ( "github.com/mitchellh/cli" ) +func TestMaintCommand_noTabs(t *testing.T) { + t.Parallel() + if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') { + t.Fatal("usage has tabs") + } +} + func TestMaintCommand_ConflictingArgs(t *testing.T) { t.Parallel() ui := cli.NewMockUi() diff --git a/command/members/members_test.go b/command/members/members_test.go index a227bbbb10..8780e7db88 100644 --- a/command/members/members_test.go +++ b/command/members/members_test.go @@ -9,6 +9,13 @@ import ( "github.com/mitchellh/cli" ) +func TestMembersCommand_noTabs(t *testing.T) { + t.Parallel() + if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') { + t.Fatal("usage has tabs") + } +} + func TestMembersCommand(t *testing.T) { t.Parallel() a := agent.NewTestAgent(t.Name(), ``) diff --git a/command/watch/watch_test.go b/command/watch/watch_test.go index aede3ed360..8005204885 100644 --- a/command/watch/watch_test.go +++ b/command/watch/watch_test.go @@ -8,6 +8,13 @@ import ( "github.com/mitchellh/cli" ) +func TestWatchCommand_noTabs(t *testing.T) { + t.Parallel() + if strings.ContainsRune(New(cli.NewMockUi(), nil).Help(), '\t') { + t.Fatal("usage has tabs") + } +} + func TestWatchCommand(t *testing.T) { t.Parallel() a := agent.NewTestAgent(t.Name(), ``)