4 # Regression tests for date(1)
6 # Submitted by Edwin Groothuis <edwin@FreeBSD.org>
12 # These two date/times have been chosen carefully, they
13 # create both the single digit and double/multidigit version of
16 # To create a new one, make sure you are using the UTC timezone!
19 TEST1=3222243 # 1970-02-07 07:04:03
20 TEST2=1005600000 # 2001-11-12 21:11:12
32 count=`expr ${count} + 1`
34 if [ -z "${A2}" ]; then A2=${A1}; fi
36 R=`date -r ${TEST1} +%${S}`
37 if [ "${R}" = "${A1}" ]; then
38 echo "${count}a. ${S} - ok"
40 echo "${count}a. ${S} - not ok (got ${R}, expected ${A1})"
43 R=`date -r ${TEST2} +%${S}`
44 if [ "${R}" = "${A2}" ]; then
45 echo "${count}b. ${S} - ok"
47 echo "${count}b. ${S} - not ok (got ${R}, expected ${A2})"
51 check A Saturday Monday
53 check B February November
56 check c "Sat Feb 7 07:04:03 1970" "Mon Nov 12 21:20:00 2001"
57 check D 02/07/70 11/12/01
60 check F "1970-02-07" "2001-11-12"
73 check r "07:04:03 AM" "09:20:00 PM"
75 check s ${TEST1} ${TEST2}
79 check v " 7-Feb-1970" "12-Nov-2001"
82 check X "07:04:03" "21:20:00"
83 check x "02/07/70" "11/12/01"
89 check + "Sat Feb 7 07:04:03 UTC 1970" "Mon Nov 12 21:20:00 UTC 2001"