You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
469 B

  1. package humanize
  2. import (
  3. "testing"
  4. )
  5. func TestOrdinals(t *testing.T) {
  6. testList{
  7. {"0", Ordinal(0), "0th"},
  8. {"1", Ordinal(1), "1st"},
  9. {"2", Ordinal(2), "2nd"},
  10. {"3", Ordinal(3), "3rd"},
  11. {"4", Ordinal(4), "4th"},
  12. {"10", Ordinal(10), "10th"},
  13. {"11", Ordinal(11), "11th"},
  14. {"12", Ordinal(12), "12th"},
  15. {"13", Ordinal(13), "13th"},
  16. {"101", Ordinal(101), "101st"},
  17. {"102", Ordinal(102), "102nd"},
  18. {"103", Ordinal(103), "103rd"},
  19. }.validate(t)
  20. }