From 776257e4c5af3129b9aba2f46c182ca887c6d862 Mon Sep 17 00:00:00 2001 From: umarcor Date: Tue, 30 Aug 2022 19:40:39 +0200 Subject: [PATCH] fix --- args_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/args_test.go b/args_test.go index e84e8d100..c2489855b 100644 --- a/args_test.go +++ b/args_test.go @@ -38,12 +38,12 @@ func validOnlyWithInvalidArgs(err error, t *testing.T) { } } -func noArgsWithArgs(err error, t *testing.T) { +func noArgsWithArgs(err error, t *testing.T, arg string) { if err == nil { t.Fatal("Expected an error") } got := err.Error() - expected := `unknown command "one" for "c"` + expected := `unknown command "` + arg + `" for "c"` if got != expected { t.Errorf("Expected: %q, got: %q", expected, got) } @@ -104,19 +104,19 @@ func TestNoArgs(t *testing.T) { func TestNoArgs_WithArgs(t *testing.T) { c := getCommand(NoArgs, false) _, err := executeCommand(c, "one") - noArgsWithArgs(err, t) + noArgsWithArgs(err, t, "one") } func TestNoArgs_WithValid_WithArgs(t *testing.T) { c := getCommand(NoArgs, true) _, err := executeCommand(c, "one") - noArgsWithArgs(err, t) + noArgsWithArgs(err, t, "one") } func TestNoArgs_WithValid_WithInvalidArgs(t *testing.T) { c := getCommand(NoArgs, true) _, err := executeCommand(c, "a") - noArgsWithArgs(err, t) + noArgsWithArgs(err, t, "a") } func TestNoArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {