Matching arg field (#1)
Check if the first field of an argument branch matches the parent struct field.
This commit is contained in:
committed by
Alec Thomas
parent
67b1a12059
commit
b4b5827044
+12
-1
@@ -98,10 +98,21 @@ func TestArgSlice(t *testing.T) {
|
||||
require.Equal(t, true, cli.Flag)
|
||||
}
|
||||
|
||||
func TestUnsupportedfieldErrors(t *testing.T) {
|
||||
func TestUnsupportedFieldErrors(t *testing.T) {
|
||||
var cli struct {
|
||||
Keys map[string]string
|
||||
}
|
||||
_, err := New("", "", &cli)
|
||||
require.Error(t, err)
|
||||
}
|
||||
|
||||
func TestMatchingArgField(t *testing.T) {
|
||||
var cli struct {
|
||||
ID struct {
|
||||
NotID int `arg:""`
|
||||
} `arg:""`
|
||||
}
|
||||
|
||||
_, err := New("", "", &cli)
|
||||
require.Error(t, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user