inns_test.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. package inns
  2. import (
  3. "testing"
  4. )
  5. var (
  6. testStrInns = []string{
  7. "663802 397223",
  8. "8252 47222169",
  9. "8712530 92145",
  10. "0873 820 72512",
  11. "227 62 3382327",
  12. "886 62 2222010",
  13. "464 350 209157",
  14. "758956582077",
  15. "212551260755",
  16. "0432444 61455",
  17. "428880301819",
  18. "61309 59 33498",
  19. "667344101205",
  20. "6189115998",
  21. "426 1455105",
  22. "562 5340715",
  23. "6588135629",
  24. "253 7102466",
  25. "8195196 357",
  26. "23838 17246",
  27. "812 5976843",
  28. "4710 107563",
  29. "3732 71726",
  30. "2170 439945",
  31. "2193865 820",
  32. "8122 281402",
  33. }
  34. testStrInnsErr = []string{
  35. "66380a2397223",
  36. "825247222eu169",
  37. "8712530921457553",
  38. "087753382072512",
  39. "22762hetu3382327",
  40. "886ao622222010",
  41. "4643he50209157",
  42. "75895 te 6582077",
  43. "2asn12551260755",
  44. "043abc244461455",
  45. "428880err301819",
  46. "0x613095933498",
  47. "667344101205h",
  48. "618911xerr5998",
  49. "426x1455105",
  50. "562x5340715",
  51. "658813moreerr5629",
  52. "253x7102466",
  53. "8195196x357",
  54. "23check838 17246",
  55. "8check12x5976843",
  56. "4710x107563",
  57. "03732x71726",
  58. "2170x439945",
  59. "2193865x820",
  60. "81shit2 281402",
  61. }
  62. )
  63. func TestInnFromStr(t *testing.T) {
  64. for _, rawInn := range testStrInns {
  65. _, err := NewFromStr(rawInn)
  66. if err != nil {
  67. t.Fatalf("InnFromStr(%q), err == %q", rawInn, err)
  68. }
  69. }
  70. for _, rawInn := range testStrInnsErr {
  71. _, err := NewFromStr(rawInn)
  72. if err == nil {
  73. t.Fatalf("InnFromStr(%q), err == %v, must be though", rawInn, err)
  74. }
  75. }
  76. }