1
0

inbound_util_test.go 353 B

1234567891011121314151617181920
  1. package service
  2. import "testing"
  3. func TestNormalizeSubSortIndex(t *testing.T) {
  4. cases := []struct {
  5. in, want int
  6. }{
  7. {0, 1},
  8. {1, 1},
  9. {7, 7},
  10. {-1, -1},
  11. {-10, -10},
  12. }
  13. for _, tc := range cases {
  14. if got := normalizeSubSortIndex(tc.in); got != tc.want {
  15. t.Fatalf("normalizeSubSortIndex(%d) = %d, want %d", tc.in, got, tc.want)
  16. }
  17. }
  18. }