Skip to content

Commit

Permalink
failing test case for issue #69
Browse files Browse the repository at this point in the history
  • Loading branch information
mroth committed Mar 26, 2022
1 parent 9d53550 commit 31938b2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions commands/internal/arguments/arguments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ var testExpandCases = []struct {
{"1 3 7", "$e1 $e3 $e7"},
{"1-3 6", "$e1 $e2 $e3 $e6"},
{"seven 2-5 1", "seven $e2 $e3 $e4 $e5 $e1"},
// Test cases for https://github.com/mroth/scmpuff/issues/69
{"log -1 1", "log -1 $e1"},
{"log -n1 2", "log -n1 $e2"},
{"log -n 1 2", "log -n 1 $e2"},
}

func TestExpand(t *testing.T) {
Expand All @@ -25,7 +29,7 @@ func TestExpand(t *testing.T) {
expected := strings.Split(tc.expected, " ")
actual := Expand(args)
if !reflect.DeepEqual(actual, expected) {
t.Fatalf("ExpandArgs(%v): expected %v, actual %v", tc.args, expected, actual)
t.Errorf("ExpandArgs(%v): expected %v, actual %v", tc.args, expected, actual)
}
}
}
Expand All @@ -44,7 +48,7 @@ func TestExpandArg(t *testing.T) {
for _, tc := range testExpandArgCases {
actual := expandArg(tc.arg)
if !reflect.DeepEqual(actual, tc.expected) {
t.Fatalf("ExpandArg(%v): expected %v, actual %v", tc.arg, tc.expected, actual)
t.Errorf("ExpandArg(%v): expected %v, actual %v", tc.arg, tc.expected, actual)
}
}
}
Expand Down

0 comments on commit 31938b2

Please sign in to comment.