summaryrefslogtreecommitdiff
path: root/release/src/router/busybox/testsuite/date/date-works
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2015-01-03 13:58:15 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2015-01-03 13:58:15 +0100
commit4aca87515a5083ae0e31ce3177189fd43b6d05ac (patch)
tree7b1d9a31393ca090757dc6f0d3859b4fcd93f271 /release/src/router/busybox/testsuite/date/date-works
parent008d0be72b2f160382c6e880765e96b64a050c65 (diff)
downloadtomato-4aca87515a5083ae0e31ce3177189fd43b6d05ac.tar.gz
tomato-4aca87515a5083ae0e31ce3177189fd43b6d05ac.tar.bz2
patch to Vanilla Tomato 1.28
Diffstat (limited to 'release/src/router/busybox/testsuite/date/date-works')
-rw-r--r--release/src/router/busybox/testsuite/date/date-works44
1 files changed, 44 insertions, 0 deletions
diff --git a/release/src/router/busybox/testsuite/date/date-works b/release/src/router/busybox/testsuite/date/date-works
new file mode 100644
index 00000000..0802e887
--- /dev/null
+++ b/release/src/router/busybox/testsuite/date/date-works
@@ -0,0 +1,44 @@
+dt=`busybox date`
+# Expected format: Fri Apr 25 03:47:55 CEST 2008
+dt=`echo "$dt" | sed 's/^[^ ][^ ][^ ] [^ ][^ ][^ ] [ 0123][0-9] [012][0-9]:[0-5][0-9]:[0-6][0-9] [A-Z][A-Z]* [012][0-9][0-9][0-9]$/OK/'`
+test x"$dt" = x"OK"
+
+dt=`busybox date -d 1:2`
+dt=`echo "$dt" | cut -b12-19`
+test x"$dt" = x"01:02:00"
+
+dt=`busybox date -d 1:2:3`
+dt=`echo "$dt" | cut -b12-19`
+test x"$dt" = x"01:02:03"
+
+dt=`busybox date -d 1.2-3:4`
+dt=`echo "$dt" | cut -b5-19`
+test x"$dt" = x"Jan 2 03:04:00"
+
+dt=`busybox date -d 1.2-3:4:5`
+dt=`echo "$dt" | cut -b5-19`
+test x"$dt" = x"Jan 2 03:04:05"
+
+dt=`busybox date -d 1999.1.2-3:4`
+dt=`echo "$dt" | cut -b1-19`
+test x"$dt" = x"Sat Jan 2 03:04:00"
+
+dt=`busybox date -d 1999.1.2-3:4:5`
+dt=`echo "$dt" | cut -b1-19`
+test x"$dt" = x"Sat Jan 2 03:04:05"
+
+dt=`busybox date -d '1999-1-2 3:4:5'`
+dt=`echo "$dt" | cut -b1-19`
+test x"$dt" = x"Sat Jan 2 03:04:05"
+
+dt=`busybox date -d 01231133`
+dt=`echo "$dt" | cut -b5-19`
+test x"$dt" = x"Jan 23 11:33:00"
+
+dt=`busybox date -d 012311332000`
+dt=`echo "$dt" | cut -b1-19`
+test x"$dt" = x"Sun Jan 23 11:33:00"
+
+dt=`busybox date -d 012311332000.30`
+dt=`echo "$dt" | cut -b1-19`
+test x"$dt" = x"Sun Jan 23 11:33:30"