reverse_test.go 372 B

123456789101112131415161718
  1. package help
  2. import "testing"
  3. func TestReverse(t *testing.T) {
  4. tests := []struct {
  5. input interface{}
  6. want []interface{}
  7. }{
  8. {[]int{1, 2, 3}, []interface{}{3, 2, 1}},
  9. }
  10. for _, test := range tests {
  11. if q := From(test.input).Reverse(); !validateQuery(q, test.want) {
  12. t.Errorf("From(%v).Reverse()=%v expected %v", test.input, toSlice(q), test.want)
  13. }
  14. }
  15. }