File: 0001-Make-test-case-compatible-with-Go-1.17-1299.patch

package info (click to toggle)
golang-github-urfave-cli-v2 2.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,504 kB
  • sloc: sh: 17; makefile: 4
file content (41 lines) | stat: -rw-r--r-- 1,125 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From e8d81738896cbec66cff42e384d3d558a96fa26f Mon Sep 17 00:00:00 2001
From: William Wilson <william.wilson@canonical.com>
Date: Sun, 5 Dec 2021 13:56:34 -0600
Subject: [PATCH] Make test case compatible with Go 1.17 (#1299)

* Make test case compatible with Go 1.17

* tweak test case to bring coverage back up
---
 app_test.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app_test.go b/app_test.go
index 7c38f60..76e211d 100644
--- a/app_test.go
+++ b/app_test.go
@@ -476,18 +476,18 @@ func TestApp_RunAsSubCommandIncorrectUsage(t *testing.T) {
 	a := App{
 		Name: "cmd",
 		Flags: []Flag{
-			&StringFlag{Name: "--foo"},
+			&StringFlag{Name: "foo"},
 		},
 		Writer: bytes.NewBufferString(""),
 	}
 
 	set := flag.NewFlagSet("", flag.ContinueOnError)
-	_ = set.Parse([]string{"", "---foo"})
+	_ = set.Parse([]string{"", "-bar"})
 	c := &Context{flagSet: set}
 
 	err := a.RunAsSubcommand(c)
 
-	expect(t, err, errors.New("bad flag syntax: ---foo"))
+	expect(t, err.Error(), "flag provided but not defined: -bar")
 }
 
 func TestApp_CommandWithFlagBeforeTerminator(t *testing.T) {
-- 
2.34.1