Implement a robust Context.Run().

This helps when composing large applications from separate command
structs.
This commit is contained in:
Alec Thomas
2018-06-21 21:50:30 +10:00
parent e4f37b5d1a
commit a2ec050947
16 changed files with 727 additions and 279 deletions
+5 -3
View File
@@ -1,9 +1,11 @@
package kong
package kong_test
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/alecthomas/kong"
)
func TestDefaultValueForOptionalArg(t *testing.T) {
@@ -42,7 +44,7 @@ func TestBadString(t *testing.T) {
var cli struct {
Numbers string `kong:"default='yay'n"`
}
_, err := New(&cli)
_, err := kong.New(&cli)
require.Error(t, err)
}
@@ -50,7 +52,7 @@ func TestNoQuoteEnd(t *testing.T) {
var cli struct {
Numbers string `kong:"default='yay"`
}
_, err := New(&cli)
_, err := kong.New(&cli)
require.Error(t, err)
}