summaryrefslogtreecommitdiffstats
path: root/tests/clock.test
diff options
context:
space:
mode:
authorericm <ericm>2000-05-18 22:29:55 (GMT)
committerericm <ericm>2000-05-18 22:29:55 (GMT)
commitb18b0c87fd558e2ac08afee5f57cf63d26e8616c (patch)
tree09f7bd8bceecf28f329ecac1c3595ad42b49d34c /tests/clock.test
parenta8277571fc968b11adf51c2fb8071937cd1bdf2e (diff)
downloadtcl-b18b0c87fd558e2ac08afee5f57cf63d26e8616c.zip
tcl-b18b0c87fd558e2ac08afee5f57cf63d26e8616c.tar.gz
tcl-b18b0c87fd558e2ac08afee5f57cf63d26e8616c.tar.bz2
* tests/clock.test: Added test for "2 days 2 hours ago" style
specifications. * generic/tclDate.c: Regenerated from tclGetDate.y. * generic/tclGetDate.y: Tweaked grammar to properly handle the "ago" keyword when it follows multiple relative unit specifiers, as in "2 days 2 hours ago". [Bug: 5497].
Diffstat (limited to 'tests/clock.test')
-rw-r--r--tests/clock.test7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/clock.test b/tests/clock.test
index 926ac1c..a0a4d6b 100644
--- a/tests/clock.test
+++ b/tests/clock.test
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: clock.test,v 1.13 2000/04/10 17:18:57 ericm Exp $
+# RCS: @(#) $Id: clock.test,v 1.14 2000/05/18 22:29:56 ericm Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -337,6 +337,11 @@ test clock-4.40 {last monday in november} knownBug {
}
set res
} {1991-11-25 1992-11-30 1993-11-29 1994-11-28 1995-11-27 1996-11-25}
+test clock-4.41 {ago with multiple relative units} {
+ set base [clock scan "12/31/1999 00:00:00"]
+ set res [clock scan "2 days 2 hours ago" -base $base]
+ expr {$base - $res}
+} 180000
# clock seconds
test clock-5.1 {clock seconds tests} {