TESTS 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #! /bin/sh
  2. # '%W%'
  3. rm -f -r try
  4. mkdir try
  5. make `make names`
  6. cp `make names` try
  7. cd try
  8. make date right_only TZDIR=zoneinfo CFLAGS="-g -DEBUG $*"
  9. set -v
  10. # America/New_York tests
  11. TZ=America/New_York
  12. export TZ
  13. # All the legal forms.
  14. ./date 2007
  15. ./date 2007.44
  16. ./date 112007
  17. ./date 112007.44
  18. ./date 03022007
  19. ./date 03022007.44
  20. ./date 8903022007
  21. ./date 8903022007.44
  22. ./date 0302200789
  23. ./date 0302200789.44
  24. ./date 198903022007.44
  25. # Illegal forms
  26. ./date 030220071989
  27. ./date 030220071989.44
  28. # Far future times
  29. ./date 200103022007.44
  30. ./date 210103022007.44
  31. # Far past time--only legal as USG-style
  32. ./date 0103022007.44
  33. # Ambiguous, BSD vs. USG
  34. ./date 0203040506
  35. # Unambiguous, BSD vs. USG
  36. ./date 0202020202
  37. # Times around spring forward
  38. ./date 198904020130.00
  39. ./date 198904020159.59
  40. ./date 198904020200.00
  41. ./date 198904020200.01
  42. ./date 198904020230.00
  43. ./date 198904020259.59
  44. ./date 198904020300.00
  45. ./date 198904020300.01
  46. ./date 198904020330.00
  47. # Times around fall back
  48. ./date 198910290030.00
  49. ./date 198910290059.59
  50. ./date 198910290100.00
  51. ./date 198910290100.01
  52. ./date 198910290130.00
  53. ./date 198910290159.59
  54. ./date 198910290200.00
  55. ./date 198910290200.01
  56. ./date 198910290230.00
  57. #
  58. # Wrong leap second
  59. ./date 198712312359.60
  60. # Right leap second
  61. ./date 198712311859.60
  62. # Mideast Madness
  63. # Should get an "ambiguous time" message
  64. TZ=Mideast/Riyadh89 ./date 198906011200
  65. # Should get a "spring forward" message
  66. TZ=Mideast/Riyadh89 ./date 198903011159.59
  67. # British Balminess
  68. # Should get an "ambiguous time" message
  69. TZ=GB-Eire ./date 197110310030
  70. # Wrong content
  71. ./date ""
  72. ./date xxx
  73. # Wrong length
  74. ./date 123
  75. # Multiple dots
  76. ./date 1234..56
  77. # Dot, no seconds
  78. ./date 1234.
  79. # Dot, no main part
  80. ./date .56
  81. # Wrong length seconds
  82. ./date 1234.5
  83. ./date 1234.567