From 44455258be2eb95e93f3f00acc119752c541fb71 Mon Sep 17 00:00:00 2001 From: Francis Nickels Date: Mon, 19 Sep 2022 10:44:47 -0700 Subject: [PATCH] Set Camel Case on const --- command_test.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/command_test.go b/command_test.go index d8ff19ff..1c0bfca5 100644 --- a/command_test.go +++ b/command_test.go @@ -2162,8 +2162,8 @@ func TestSetContextPersistentPreRun(t *testing.T) { } } -const VERSION_FLAG = "--version" -const HELP_FLAG = "--help" +const VersionFlag = "--version" +const HelpFlag = "--help" func TestNoRootRunCommandExecutedWithVersionSet(t *testing.T) { rootCmd := &Command{Use: "root", Version: "1.0.0", Long: "Long description"} @@ -2175,8 +2175,8 @@ func TestNoRootRunCommandExecutedWithVersionSet(t *testing.T) { } checkStringContains(t, output, rootCmd.Long) - checkStringContains(t, output, HELP_FLAG) - checkStringContains(t, output, VERSION_FLAG) + checkStringContains(t, output, HelpFlag) + checkStringContains(t, output, VersionFlag) } func TestNoRootRunCommandExecutedWithoutVersionSet(t *testing.T) { @@ -2189,8 +2189,8 @@ func TestNoRootRunCommandExecutedWithoutVersionSet(t *testing.T) { } checkStringContains(t, output, rootCmd.Long) - checkStringContains(t, output, HELP_FLAG) - checkStringOmits(t, output, VERSION_FLAG) + checkStringContains(t, output, HelpFlag) + checkStringOmits(t, output, VersionFlag) } func TestHelpCommandExecutedWithVersionSet(t *testing.T) { @@ -2203,8 +2203,8 @@ func TestHelpCommandExecutedWithVersionSet(t *testing.T) { } checkStringContains(t, output, rootCmd.Long) - checkStringContains(t, output, HELP_FLAG) - checkStringContains(t, output, VERSION_FLAG) + checkStringContains(t, output, HelpFlag) + checkStringContains(t, output, VersionFlag) } func TestHelpCommandExecutedWithoutVersionSet(t *testing.T) { @@ -2217,34 +2217,34 @@ func TestHelpCommandExecutedWithoutVersionSet(t *testing.T) { } checkStringContains(t, output, rootCmd.Long) - checkStringContains(t, output, HELP_FLAG) - checkStringOmits(t, output, VERSION_FLAG) + checkStringContains(t, output, HelpFlag) + checkStringOmits(t, output, VersionFlag) } func TestHelpflagCommandExecutedWithVersionSet(t *testing.T) { rootCmd := &Command{Use: "root", Version: "1.0.0", Long: "Long description", Run: emptyRun} rootCmd.AddCommand(&Command{Use: "child", Run: emptyRun}) - output, err := executeCommand(rootCmd, HELP_FLAG) + output, err := executeCommand(rootCmd, HelpFlag) if err != nil { t.Errorf("Unexpected error: %v", err) } checkStringContains(t, output, rootCmd.Long) - checkStringContains(t, output, HELP_FLAG) - checkStringContains(t, output, VERSION_FLAG) + checkStringContains(t, output, HelpFlag) + checkStringContains(t, output, VersionFlag) } func TestHelpflagCommandExecutedWithoutVersionSet(t *testing.T) { rootCmd := &Command{Use: "root", Long: "Long description", Run: emptyRun} rootCmd.AddCommand(&Command{Use: "child", Run: emptyRun}) - output, err := executeCommand(rootCmd, HELP_FLAG) + output, err := executeCommand(rootCmd, HelpFlag) if err != nil { t.Errorf("Unexpected error: %v", err) } checkStringContains(t, output, rootCmd.Long) - checkStringContains(t, output, HELP_FLAG) - checkStringOmits(t, output, VERSION_FLAG) + checkStringContains(t, output, HelpFlag) + checkStringOmits(t, output, VersionFlag) }