From 1c4989c1933af587e809be985f1dc6e388128f01 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sat, 27 Jun 2026 13:38:14 +0200 Subject: [PATCH] test(cmd): adapt TestCliCmdError to urfave/cli v3.10 behavior cli v3.10.0 now prints the usage help to stdout (in addition to the "Incorrect Usage" message on stderr) when a command gets an unknown flag, so the test can no longer assert an empty stdout. Assisted-by: Claude:Opus-4.8 --- cmd/cmdtest/cmd_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/cmdtest/cmd_test.go b/cmd/cmdtest/cmd_test.go index 6d4937fa110..db6edae316b 100644 --- a/cmd/cmdtest/cmd_test.go +++ b/cmd/cmdtest/cmd_test.go @@ -202,7 +202,7 @@ func TestCliCmdError(t *testing.T) { r, err = runTestApp(app, "./gitea", "test-cmd", "--no-such") assert.Error(t, err) assert.Equal(t, 1, r.ExitCode) - assert.Empty(t, r.Stdout) + assert.NotEmpty(t, r.Stdout) // since cli v3.10, the usage help is printed to stdout on a usage error assert.Equal(t, "Incorrect Usage: flag provided but not defined: -no-such\n\n", r.Stderr) app = newTestApp(cli.Command{Action: func(ctx context.Context, cmd *cli.Command) error { return nil }})