Skip to content

Commit

Permalink
Merge 063a487 into 6f3675f
Browse files Browse the repository at this point in the history
  • Loading branch information
alexflint committed Apr 3, 2020
2 parents 6f3675f + 063a487 commit 32f57e6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Go

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Build
run: go build -v .

- name: Test
run: go test -v .
11 changes: 5 additions & 6 deletions usage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ Options:
var help bytes.Buffer
p.WriteHelp(&help)
actual := help.String()
t.Logf("Expected:\n%s", expectedHelp)
t.Logf("Actual:\n%s", actual)
if expectedHelp != actual {
t.Logf("Expected:\n%s", expectedHelp)
t.Logf("Actual:\n%s", actual)
t.Fail()
}
}
Expand All @@ -243,9 +243,9 @@ Options:
var help bytes.Buffer
p.WriteHelp(&help)
actual := help.String()
t.Logf("Expected:\n%s", expectedHelp)
t.Logf("Actual:\n%s", actual)
if expectedHelp != actual {
t.Logf("Expected:\n%s", expectedHelp)
t.Logf("Actual:\n%s", actual)
t.Fail()
}
}
Expand All @@ -271,7 +271,7 @@ Options:
assert.Equal(t, expectedHelp, help.String())
}

func TestUsagWithNestedSubcommands(t *testing.T) {
func TestUsageWithNestedSubcommands(t *testing.T) {
expectedHelp := `Usage: example child nested [--enable] OUTPUT
Positional arguments:
Expand Down Expand Up @@ -305,6 +305,5 @@ Global options:

var help bytes.Buffer
p.WriteHelp(&help)
fmt.Println(help.String())
assert.Equal(t, expectedHelp, help.String())
}

0 comments on commit 32f57e6

Please sign in to comment.