Update TestCommandIgnoreFlagsIncludingFirstArgument to test for arguments

This commit is contained in:
Jesse Szwedko 2015-10-26 21:45:28 -07:00
parent 6191d931b7
commit 8cd49b108c
2 changed files with 4 additions and 3 deletions

View File

@ -64,6 +64,7 @@ func TestCommandIgnoreFlagsIncludingFirstArgument(t *testing.T) {
SkipFlagParsing: true, SkipFlagParsing: true,
} }
err := command.Run(c) err := command.Run(c)
expect(t, err, nil) expect(t, err, nil)
expect(t, []string(c.Args()), []string{"blah", "-break"})
} }

View File

@ -7,13 +7,13 @@ import (
/* Test Helpers */ /* Test Helpers */
func expect(t *testing.T, a interface{}, b interface{}) { func expect(t *testing.T, a interface{}, b interface{}) {
if a != b { if !reflect.DeepEqual(a, b) {
t.Errorf("Expected %v (type %v) - Got %v (type %v)", b, reflect.TypeOf(b), a, reflect.TypeOf(a)) t.Errorf("Expected %v (type %v) - Got %v (type %v)", b, reflect.TypeOf(b), a, reflect.TypeOf(a))
} }
} }
func refute(t *testing.T, a interface{}, b interface{}) { func refute(t *testing.T, a interface{}, b interface{}) {
if a == b { if reflect.DeepEqual(a, b) {
t.Errorf("Did not expect %v (type %v) - Got %v (type %v)", b, reflect.TypeOf(b), a, reflect.TypeOf(a)) t.Errorf("Did not expect %v (type %v) - Got %v (type %v)", b, reflect.TypeOf(b), a, reflect.TypeOf(a))
} }
} }