Skip to content

Commit

Permalink
tpl: Test with nil value in first, last, after and shuffle
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Feb 7, 2016
1 parent 3cc468a commit f90b45f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tpl/template_funcs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ func TestFirst(t *testing.T) {
{1, nil, false},
{nil, []int{100}, false},
{1, t, false},
{1, (*string)(nil), false},
} {
results, err := first(this.count, this.sequence)
if b, ok := this.expect.(bool); ok && !b {
Expand Down Expand Up @@ -300,6 +301,7 @@ func TestLast(t *testing.T) {
{1, nil, false},
{nil, []int{100}, false},
{1, t, false},
{1, (*string)(nil), false},
} {
results, err := last(this.count, this.sequence)
if b, ok := this.expect.(bool); ok && !b {
Expand Down Expand Up @@ -334,6 +336,7 @@ func TestAfter(t *testing.T) {
{1, nil, false},
{nil, []int{100}, false},
{1, t, false},
{1, (*string)(nil), false},
} {
results, err := after(this.count, this.sequence)
if b, ok := this.expect.(bool); ok && !b {
Expand Down Expand Up @@ -367,6 +370,7 @@ func TestShuffleInputAndOutputFormat(t *testing.T) {
{[]int{100}, true},
{nil, false},
{t, false},
{(*string)(nil), false},
} {
results, err := shuffle(this.sequence)
if !this.success {
Expand Down

0 comments on commit f90b45f

Please sign in to comment.