date-tests
来自「实战Linux编程的原代码,希望对学驱动的人能有所帮助」· 代码 · 共 1,108 行 · 第 1/4 页
TXT
1,108 行
2) $echo "Test rel-2e(LANG=C TZ=UTC0) may have failed." 1>&2 $echo The command "cmp rel-2e.O $srcdir/rel-2e.X" failed. 1>&2 errors=`expr $errors + 1`;; esacfitest -s rel-2e.E || rm -f rel-2e.ELANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0 3 minutes ago' '+%Y-%m-%d %T' > rel-2f.O 2> rel-2f.Ecode=$?if test $code != 0; then $echo "Test rel-2f(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2 errors=`expr $errors + 1`else cmp rel-2f.O $srcdir/rel-2f.X > /dev/null 2>&1 case $? in 0) if test "$VERBOSE"; then $echo "passed rel-2f(LANG=C TZ=UTC0)"; fi;; 1) $echo "Test rel-2f(LANG=C TZ=UTC0) failed: files rel-2f.O and $srcdir/rel-2f.X differ" 1>&2 (diff -c rel-2f.O $srcdir/rel-2f.X) 2> /dev/null errors=`expr $errors + 1`;; 2) $echo "Test rel-2f(LANG=C TZ=UTC0) may have failed." 1>&2 $echo The command "cmp rel-2f.O $srcdir/rel-2f.X" failed. 1>&2 errors=`expr $errors + 1`;; esacfitest -s rel-2f.E || rm -f rel-2f.ELANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0 4 seconds ago' '+%Y-%m-%d %T' > rel-2g.O 2> rel-2g.Ecode=$?if test $code != 0; then $echo "Test rel-2g(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2 errors=`expr $errors + 1`else cmp rel-2g.O $srcdir/rel-2g.X > /dev/null 2>&1 case $? in 0) if test "$VERBOSE"; then $echo "passed rel-2g(LANG=C TZ=UTC0)"; fi;; 1) $echo "Test rel-2g(LANG=C TZ=UTC0) failed: files rel-2g.O and $srcdir/rel-2g.X differ" 1>&2 (diff -c rel-2g.O $srcdir/rel-2g.X) 2> /dev/null errors=`expr $errors + 1`;; 2) $echo "Test rel-2g(LANG=C TZ=UTC0) may have failed." 1>&2 $echo The command "cmp rel-2g.O $srcdir/rel-2g.X" failed. 1>&2 errors=`expr $errors + 1`;; esacfitest -s rel-2g.E || rm -f rel-2g.ELANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0 4 seconds ago' '+%Y-%m-%d %T' > rel-3a.O 2> rel-3a.Ecode=$?if test $code != 0; then $echo "Test rel-3a(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2 errors=`expr $errors + 1`else cmp rel-3a.O $srcdir/rel-3a.X > /dev/null 2>&1 case $? in 0) if test "$VERBOSE"; then $echo "passed rel-3a(LANG=C TZ=UTC0)"; fi;; 1) $echo "Test rel-3a(LANG=C TZ=UTC0) failed: files rel-3a.O and $srcdir/rel-3a.X differ" 1>&2 (diff -c rel-3a.O $srcdir/rel-3a.X) 2> /dev/null errors=`expr $errors + 1`;; 2) $echo "Test rel-3a(LANG=C TZ=UTC0) may have failed." 1>&2 $echo The command "cmp rel-3a.O $srcdir/rel-3a.X" failed. 1>&2 errors=`expr $errors + 1`;; esacfitest -s rel-3a.E || rm -f rel-3a.ELANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0 next second' '+%Y-%m-%d %T' > next-s.O 2> next-s.Ecode=$?if test $code != 0; then $echo "Test next-s(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2 errors=`expr $errors + 1`else cmp next-s.O $srcdir/next-s.X > /dev/null 2>&1 case $? in 0) if test "$VERBOSE"; then $echo "passed next-s(LANG=C TZ=UTC0)"; fi;; 1) $echo "Test next-s(LANG=C TZ=UTC0) failed: files next-s.O and $srcdir/next-s.X differ" 1>&2 (diff -c next-s.O $srcdir/next-s.X) 2> /dev/null errors=`expr $errors + 1`;; 2) $echo "Test next-s(LANG=C TZ=UTC0) may have failed." 1>&2 $echo The command "cmp next-s.O $srcdir/next-s.X" failed. 1>&2 errors=`expr $errors + 1`;; esacfitest -s next-s.E || rm -f next-s.ELANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0 next minute' '+%Y-%m-%d %T' > next-m.O 2> next-m.Ecode=$?if test $code != 0; then $echo "Test next-m(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2 errors=`expr $errors + 1`else cmp next-m.O $srcdir/next-m.X > /dev/null 2>&1 case $? in 0) if test "$VERBOSE"; then $echo "passed next-m(LANG=C TZ=UTC0)"; fi;; 1) $echo "Test next-m(LANG=C TZ=UTC0) failed: files next-m.O and $srcdir/next-m.X differ" 1>&2 (diff -c next-m.O $srcdir/next-m.X) 2> /dev/null errors=`expr $errors + 1`;; 2) $echo "Test next-m(LANG=C TZ=UTC0) may have failed." 1>&2 $echo The command "cmp next-m.O $srcdir/next-m.X" failed. 1>&2 errors=`expr $errors + 1`;; esacfitest -s next-m.E || rm -f next-m.ELANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0 next hour' '+%Y-%m-%d %T' > next-h.O 2> next-h.Ecode=$?if test $code != 0; then $echo "Test next-h(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2 errors=`expr $errors + 1`else cmp next-h.O $srcdir/next-h.X > /dev/null 2>&1 case $? in 0) if test "$VERBOSE"; then $echo "passed next-h(LANG=C TZ=UTC0)"; fi;; 1) $echo "Test next-h(LANG=C TZ=UTC0) failed: files next-h.O and $srcdir/next-h.X differ" 1>&2 (diff -c next-h.O $srcdir/next-h.X) 2> /dev/null errors=`expr $errors + 1`;; 2) $echo "Test next-h(LANG=C TZ=UTC0) may have failed." 1>&2 $echo The command "cmp next-h.O $srcdir/next-h.X" failed. 1>&2 errors=`expr $errors + 1`;; esacfitest -s next-h.E || rm -f next-h.ELANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0 next day' '+%Y-%m-%d %T' > next-d.O 2> next-d.Ecode=$?if test $code != 0; then $echo "Test next-d(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2 errors=`expr $errors + 1`else cmp next-d.O $srcdir/next-d.X > /dev/null 2>&1 case $? in 0) if test "$VERBOSE"; then $echo "passed next-d(LANG=C TZ=UTC0)"; fi;; 1) $echo "Test next-d(LANG=C TZ=UTC0) failed: files next-d.O and $srcdir/next-d.X differ" 1>&2 (diff -c next-d.O $srcdir/next-d.X) 2> /dev/null errors=`expr $errors + 1`;; 2) $echo "Test next-d(LANG=C TZ=UTC0) may have failed." 1>&2 $echo The command "cmp next-d.O $srcdir/next-d.X" failed. 1>&2 errors=`expr $errors + 1`;; esacfitest -s next-d.E || rm -f next-d.ELANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0 next week' '+%Y-%m-%d %T' > next-w.O 2> next-w.Ecode=$?if test $code != 0; then $echo "Test next-w(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2 errors=`expr $errors + 1`else cmp next-w.O $srcdir/next-w.X > /dev/null 2>&1 case $? in 0) if test "$VERBOSE"; then $echo "passed next-w(LANG=C TZ=UTC0)"; fi;; 1) $echo "Test next-w(LANG=C TZ=UTC0) failed: files next-w.O and $srcdir/next-w.X differ" 1>&2 (diff -c next-w.O $srcdir/next-w.X) 2> /dev/null errors=`expr $errors + 1`;; 2) $echo "Test next-w(LANG=C TZ=UTC0) may have failed." 1>&2 $echo The command "cmp next-w.O $srcdir/next-w.X" failed. 1>&2 errors=`expr $errors + 1`;; esacfitest -s next-w.E || rm -f next-w.ELANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0 next month' '+%Y-%m-%d %T' > next-mo.O 2> next-mo.Ecode=$?if test $code != 0; then $echo "Test next-mo(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2 errors=`expr $errors + 1`else cmp next-mo.O $srcdir/next-mo.X > /dev/null 2>&1 case $? in 0) if test "$VERBOSE"; then $echo "passed next-mo(LANG=C TZ=UTC0)"; fi;; 1) $echo "Test next-mo(LANG=C TZ=UTC0) failed: files next-mo.O and $srcdir/next-mo.X differ" 1>&2 (diff -c next-mo.O $srcdir/next-mo.X) 2> /dev/null errors=`expr $errors + 1`;; 2) $echo "Test next-mo(LANG=C TZ=UTC0) may have failed." 1>&2 $echo The command "cmp next-mo.O $srcdir/next-mo.X" failed. 1>&2 errors=`expr $errors + 1`;; esacfitest -s next-mo.E || rm -f next-mo.ELANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0 next year' '+%Y-%m-%d %T' > next-y.O 2> next-y.Ecode=$?if test $code != 0; then $echo "Test next-y(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2 errors=`expr $errors + 1`else cmp next-y.O $srcdir/next-y.X > /dev/null 2>&1 case $? in 0) if test "$VERBOSE"; then $echo "passed next-y(LANG=C TZ=UTC0)"; fi;; 1) $echo "Test next-y(LANG=C TZ=UTC0) failed: files next-y.O and $srcdir/next-y.X differ" 1>&2 (diff -c next-y.O $srcdir/next-y.X) 2> /dev/null errors=`expr $errors + 1`;; 2) $echo "Test next-y(LANG=C TZ=UTC0) may have failed." 1>&2 $echo The command "cmp next-y.O $srcdir/next-y.X" failed. 1>&2 errors=`expr $errors + 1`;; esacfitest -s next-y.E || rm -f next-y.ETZ=UTC+4 $xx -u -d '08/01/97 6:00' '+%D,%H:%M' > utc-0.O 2> utc-0.Ecode=$?if test $code != 0; then $echo "Test utc-0(TZ=UTC+4) failed: ../../src/date return code $code differs from expected value 0" 1>&2 errors=`expr $errors + 1`else cmp utc-0.O $srcdir/utc-0.X > /dev/null 2>&1 case $? in 0) if test "$VERBOSE"; then $echo "passed utc-0(TZ=UTC+4)"; fi;; 1) $echo "Test utc-0(TZ=UTC+4) failed: files utc-0.O and $srcdir/utc-0.X differ" 1>&2 (diff -c utc-0.O $srcdir/utc-0.X) 2> /dev/null errors=`expr $errors + 1`;; 2) $echo "Test utc-0(TZ=UTC+4) may have failed." 1>&2 $echo The command "cmp utc-0.O $srcdir/utc-0.X" failed. 1>&2 errors=`expr $errors + 1`;; esacfitest -s utc-0.E || rm -f utc-0.ELANG=C TZ=UTC0 $xx -u -d '08/01/97 6:00 UTC +4 hours' '+%D,%H:%M' > utc-0a.O 2> utc-0a.Ecode=$?if test $code != 0; then $echo "Test utc-0a(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2 errors=`expr $errors + 1`else cmp utc-0a.O $srcdir/utc-0a.X > /dev/null 2>&1 case $? in 0) if test "$VERBOSE"; then $echo "passed utc-0a(LANG=C TZ=UTC0)"; fi;; 1) $echo "Test utc-0a(LANG=C TZ=UTC0) failed: files utc-0a.O and $srcdir/utc-0a.X differ" 1>&2 (diff -c utc-0a.O $srcdir/utc-0a.X) 2> /dev/null errors=`expr $errors + 1`;; 2) $echo "Test utc-0a(LANG=C TZ=UTC0) may have failed." 1>&2 $echo The command "cmp utc-0a.O $srcdir/utc-0a.X" failed. 1>&2 errors=`expr $errors + 1`;; esacfitest -s utc-0a.E || rm -f utc-0a.ETZ=UTC+1 $xx -u --file=- '+%Y-%m-%d %T' < $srcdir/utc-1.I > utc-1.O 2> utc-1.Ecode=$?if test $code != 0; then $echo "Test utc-1(TZ=UTC+1) failed: ../../src/date return code $code differs from expected value 0" 1>&2 errors=`expr $errors + 1`else cmp utc-1.O $srcdir/utc-1.X > /dev/null 2>&1 case $? in 0) if test "$VERBOSE"; then $echo "passed utc-1(TZ=UTC+1)"; fi;; 1) $echo "Test utc-1(TZ=UTC+1) failed: files utc-1.O and $srcdir/utc-1.X differ" 1>&2 (diff -c utc-1.O $srcdir/utc-1.X) 2> /dev/null errors=`expr $errors + 1`;; 2) $echo "Test utc-1(TZ=UTC+1) may have failed." 1>&2 $echo The command "cmp utc-1.O $srcdir/utc-1.X" failed. 1>&2 errors=`expr $errors + 1`;; esacfitest -s utc-1.E || rm -f utc-1.ELANG=C TZ=UTC0 $xx -u --file=- '+%Y-%m-%d %T' < $srcdir/utc-1a.I > utc-1a.O 2> utc-1a.Ecode=$?if test $code != 0; then $echo "Test utc-1a(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2 errors=`expr $errors + 1`else cmp utc-1a.O $srcdir/utc-1a.X > /dev/null 2>&1 case $? in 0) if test "$VERBOSE"; then $echo "passed utc-1a(LANG=C TZ=UTC0)"; fi;; 1) $echo "Test utc-1a(LANG=C TZ=UTC0) failed: files utc-1a.O and $srcdir/utc-1a.X differ" 1>&2 (diff -c utc-1a.O $srcdir/utc-1a.X) 2> /dev/null errors=`expr $errors + 1`;; 2) $echo "Test utc-1a(LANG=C TZ=UTC0) may have failed." 1>&2 $echo The command "cmp utc-1a.O $srcdir/utc-1a.X" failed. 1>&2 errors=`expr $errors + 1`;; esacfitest -s utc-1a.E || rm -f utc-1a.ETZ=UTC+2 $xx -d '1970-01-01 00:00:01' +%s > date2sec-0.O 2> date2sec-0.Ecode=$?if test $code != 0; then $echo "Test date2sec-0(TZ=UTC+2) failed: ../../src/date return code $code differs from expected value 0" 1>&2 errors=`expr $errors + 1`else cmp date2sec-0.O $srcdir/date2sec-0.X > /dev/null 2>&1 case $? in 0) if test "$VERBOSE"; then $echo "passed date2sec-0(TZ=UTC+2)"; fi;; 1) $echo "Test date2sec-0(TZ=UTC+2) failed: files date2sec-0.O and $srcdir/date2sec-0.X differ" 1>&2 (diff -c date2sec-0.O $srcdir/date2sec-0.X) 2> /dev/null errors=`expr $errors + 1`;; 2) $echo "Test date2sec-0(TZ=UTC+2) may have failed." 1>&2 $echo The command "cmp date2sec-0.O $srcdir/date2sec-0.X" failed. 1>&2 errors=`expr $errors + 1`;; esacfitest -s date2sec-0.E || rm -f date2sec-0.ELANG=C TZ=UTC0 $xx -d '1970-01-01 00:00:01 UTC +2 hours' +%s > date2sec-0a.O 2> date2sec-0a.E
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?