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
40 echo "no ok ${S}{t1} - (got ${R}, expected ${A1})"
43 R=`date -r ${TEST2} +%${S}`
44 if [ "${R}" = "${A2}" ]; then
47 echo "no ok ${S}{t2} - (got ${R}, expected ${A2})"
53 check A Saturday Monday
55 check B February November
58 check c "Sat Feb 7 07:04:03 1970" "Mon Nov 12 21:20:00 2001"
59 check D 02/07/70 11/12/01
62 check F "1970-02-07" "2001-11-12"
75 check r "07:04:03 AM" "09:20:00 PM"
77 check s ${TEST1} ${TEST2}
81 check v " 7-Feb-1970" "12-Nov-2001"
84 check X "07:04:03" "21:20:00"
85 check x "02/07/70" "11/12/01"
91 check + "Sat Feb 7 07:04:03 UTC 1970" "Mon Nov 12 21:20:00 UTC 2001"