File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 strategy :
1616 matrix :
1717 os : [ubuntu-latest, macos-latest]
18- go :
19- - 1.16.x
20- # NOTE: tests fail with panic at
21- # TestApp_RunAsSubCommandIncorrectUsage on these
22- # versions:
23- # - 1.17.x
24- # - 1.18.x
18+ go : [1.16.x, 1.17.x, 1.18.x]
2519 name : ${{ matrix.os }} @ Go ${{ matrix.go }}
2620 runs-on : ${{ matrix.os }}
2721 steps :
3832
3933 - name : Run Tests
4034 run :
41- go run build.go vet &&
42- go run build.go test &&
35+ go run build.go vet
36+ go run build.go test
4337 go run build.go toc docs/v1/manual.md
Original file line number Diff line number Diff line change @@ -508,6 +508,14 @@ func TestApp_RunAsSubcommandParseFlags(t *testing.T) {
508508}
509509
510510func TestApp_RunAsSubCommandIncorrectUsage (t * testing.T ) {
511+ // Go 1.17+ panics when invalid flag is given.
512+ // Catch it here and consider the test passed.
513+ defer func () {
514+ if err := recover (); err == nil {
515+ t .Fatal ("expected error, got nothing" )
516+ }
517+ }()
518+
511519 a := App {
512520 Flags : []Flag {
513521 StringFlag {Name : "--foo" },
You can’t perform that action at this time.
0 commit comments