From a1a1a6971d892c367a80213470f27a9956e62b85 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 41e6a9217..b7faa4827 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 040397655..6daa9b4ab 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 a227bbbb1..8780e7db8 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 aede3ed36..800520488 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(), ``)