Skip to content

Commit

Permalink
Merge pull request #1379 from kolyshkin/v1-fix-ci
Browse files Browse the repository at this point in the history
[v1] fix CI, add Go 1.17.x and 1.18.x
  • Loading branch information
meatballhat committed Apr 28, 2022
2 parents 1b4a05e + 6564c0f commit 936bd2e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/cli.yml
Expand Up @@ -15,13 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
go:
- 1.16.x
# NOTE: tests fail with panic at
# TestApp_RunAsSubCommandIncorrectUsage on these
# versions:
# - 1.17.x
# - 1.18.x
go: [1.16.x, 1.17.x, 1.18.x]
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -38,6 +32,6 @@ jobs:

- name: Run Tests
run:
go run build.go vet &&
go run build.go test &&
go run build.go vet
go run build.go test
go run build.go toc docs/v1/manual.md
8 changes: 8 additions & 0 deletions app_test.go
Expand Up @@ -508,6 +508,14 @@ func TestApp_RunAsSubcommandParseFlags(t *testing.T) {
}

func TestApp_RunAsSubCommandIncorrectUsage(t *testing.T) {
// Go 1.17+ panics when invalid flag is given.
// Catch it here and consider the test passed.
defer func() {
if err := recover(); err == nil {
t.Fatal("expected error, got nothing")
}
}()

a := App{
Flags: []Flag{
StringFlag{Name: "--foo"},
Expand Down

0 comments on commit 936bd2e

Please sign in to comment.