source: branches/3.2/mindi-busybox/testsuite/date/date-works @ 3232

Last change on this file since 3232 was 2725, checked in by Bruno Cornec, 9 years ago
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
File size: 1.2 KB
Line 
1dt=`busybox date`
2# Expected format: Fri Apr 25 03:47:55 CEST 2008
3dt=`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/'`
4test x"$dt" = x"OK"
5
6dt=`busybox date -d 1:2`
7dt=`echo "$dt" | cut -b12-19`
8test x"$dt" = x"01:02:00"
9
10dt=`busybox date -d 1:2:3`
11dt=`echo "$dt" | cut -b12-19`
12test x"$dt" = x"01:02:03"
13
14dt=`busybox date -d 1.2-3:4`
15dt=`echo "$dt" | cut -b5-19`
16test x"$dt" = x"Jan  2 03:04:00"
17
18dt=`busybox date -d 1.2-3:4:5`
19dt=`echo "$dt" | cut -b5-19`
20test x"$dt" = x"Jan  2 03:04:05"
21
22dt=`busybox date -d 1999.1.2-3:4`
23dt=`echo "$dt" | cut -b1-19`
24test x"$dt" = x"Sat Jan  2 03:04:00"
25
26dt=`busybox date -d 1999.1.2-3:4:5`
27dt=`echo "$dt" | cut -b1-19`
28test x"$dt" = x"Sat Jan  2 03:04:05"
29
30dt=`busybox date -d '1999-1-2 3:4:5'`
31dt=`echo "$dt" | cut -b1-19`
32test x"$dt" = x"Sat Jan  2 03:04:05"
33
34dt=`busybox date -d 01231133`
35dt=`echo "$dt" | cut -b5-19`
36test x"$dt" = x"Jan 23 11:33:00"
37
38dt=`busybox date -d 200001231133`
39dt=`echo "$dt" | cut -b1-19`
40test x"$dt" = x"Sun Jan 23 11:33:00"
41
42dt=`busybox date -d 200001231133.30`
43dt=`echo "$dt" | cut -b1-19`
44test x"$dt" = x"Sun Jan 23 11:33:30"
Note: See TracBrowser for help on using the repository browser.