summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorUrban Müller2014-07-31 14:48:56 +0200
committerUrban Müller2014-07-31 14:48:56 +0200
commit6688ddbd65983239d28ea8b1da5e70030ae88c6f (patch)
treea9e5a7f8b3551eacc8e31746eef1e583dc3ee65c /tests
parent4913c5d128abe3987bb16e462dad6543bf522f63 (diff)
downloaditools-6688ddbd65983239d28ea8b1da5e70030ae88c6f.tar.gz
itools-6688ddbd65983239d28ea8b1da5e70030ae88c6f.tar.bz2
itools-6688ddbd65983239d28ea8b1da5e70030ae88c6f.zip
support it::time
Diffstat (limited to 'tests')
-rwxr-xr-xtests/it.t11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/it.t b/tests/it.t
index 3b69072..4cf61c1 100755
--- a/tests/it.t
+++ b/tests/it.t
@@ -333,12 +333,15 @@ is(
# it::date tests
+$GLOBALS['debug_time'] = "2014-01-01";
+is(it::date(), "2014-01-01 00:00:00");
+
is(it::date('date', '2011-10-25'), '25.10.2011', 'parse date string with strtotime');
is(it::date('date', '2011-10-25 + 3 days'), '28.10.2011', 'some date arithmetic');
-is(it::date('datetime', time()), it::date('datetime'), 'recognize int as timestamp');
-is(it::date('datetime', time()*1.0), it::date('datetime'), 'recognize float as timestamp');
-is(it::date('datetime', time() . ''), it::date('datetime'), 'recognize digit string as timestamp');
-is(it::date('datetime', '@' . time()), it::date('datetime'), 'recognize strtotime timestamp format');
+is(it::date('datetime', it::time()), it::date('datetime'), 'recognize int as timestamp');
+is(it::date('datetime', it::time()*1.0), it::date('datetime'), 'recognize float as timestamp');
+is(it::date('datetime', it::time() . ''), it::date('datetime'), 'recognize digit string as timestamp');
+is(it::date('datetime', '@' . it::time()), it::date('datetime'), 'recognize strtotime timestamp format');
is(it::date('datetime', 10), it::date('datetime', "10"), 'numeric and string give same result');
is(it::date('datetime', 10.0), it::date('datetime', "10"), '... as long as num is properly truncated');
is(it::date('datetime', 10.5), it::date('datetime', "10"), '... with one digit after point');