aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-09-17 11:36:53 +0100
committerRon Yorston <rmy@pobox.com>2021-09-17 11:38:52 +0100
commit46299d0c4f4c9a4bbad38bbbe26f196e1bccdc52 (patch)
tree6194cdabc0858ae3bed0276679b3b80a722f4150 /testsuite
parentcf91de46997888b7096352805c05401e7ebae01e (diff)
parent9fe1548bbfde548d54acaab113656a56ea0ccc72 (diff)
downloadbusybox-w32-46299d0c4f4c9a4bbad38bbbe26f196e1bccdc52.tar.gz
busybox-w32-46299d0c4f4c9a4bbad38bbbe26f196e1bccdc52.tar.bz2
busybox-w32-46299d0c4f4c9a4bbad38bbbe26f196e1bccdc52.zip
Merge branch 'busybox' into merge
Disable FEATURE_TIMEZONE for now.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/date/date-timezone32
1 files changed, 32 insertions, 0 deletions
diff --git a/testsuite/date/date-timezone b/testsuite/date/date-timezone
new file mode 100644
index 000000000..8628aa1d7
--- /dev/null
+++ b/testsuite/date/date-timezone
@@ -0,0 +1,32 @@
1# FEATURE: CONFIG_FEATURE_TIMEZONE
2
3# 'Z' is UTC
4dt=$(TZ=UTC0 busybox date -d '1999-1-2 3:4:5Z')
5dt=$(echo "$dt" | cut -b1-19)
6test x"$dt" = x"Sat Jan 2 03:04:05"
7
8# '+0600' is six hours ahead of UTC
9dt=$(TZ=UTC0 busybox date -d '1999-1-2 3:4:5 +0600')
10dt=$(echo "$dt" | cut -b1-19)
11test x"$dt" = x"Fri Jan 1 21:04:05"
12
13# '-0600' is six hours behind UTC
14dt=$(TZ=UTC0 busybox date -d '1999-1-2 3:4:5 -0600')
15dt=$(echo "$dt" | cut -b1-19)
16test x"$dt" = x"Sat Jan 2 09:04:05"
17
18# before dst is switched on
19dt=$(TZ=GMT0BST,M3.5.0/1,M10.5.0/2 busybox date -d '2021-03-28 00:59:59 +0000')
20test x"$dt" = x"Sun Mar 28 00:59:59 GMT 2021"
21
22# after dst is switched on
23dt=$(TZ=GMT0BST,M3.5.0/1,M10.5.0/2 busybox date -d '2021-03-28 01:00:01 +0000')
24test x"$dt" = x"Sun Mar 28 02:00:01 BST 2021"
25
26# before dst is switched off
27dt=$(TZ=GMT0BST,M3.5.0/1,M10.5.0/2 busybox date -d '2021-10-31 00:00:01 +0000')
28test x"$dt" = x"Sun Oct 31 01:00:01 BST 2021"
29
30# after dst is switched off: back to 01:00:01 but with different TZ
31dt=$(TZ=GMT0BST,M3.5.0/1,M10.5.0/2 busybox date -d '2021-10-31 01:00:01 +0000')
32test x"$dt" = x"Sun Oct 31 01:00:01 GMT 2021"