summaryrefslogtreecommitdiffstats
path: root/tests/clock.test
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2009-06-09 13:52:36 (GMT)
committerKevin B Kenny <kennykb@acm.org>2009-06-09 13:52:36 (GMT)
commit77651df52750776dce287030cc8a1d2c0bf61385 (patch)
treeb2dcc08f29597ef2f2118108a90471a3acb0e559 /tests/clock.test
parenta7d705dbe689171d9fe8c79b7fc19bb2ef0ae7a1 (diff)
downloadtcl-77651df52750776dce287030cc8a1d2c0bf61385.zip
tcl-77651df52750776dce287030cc8a1d2c0bf61385.tar.gz
tcl-77651df52750776dce287030cc8a1d2c0bf61385.tar.bz2
* generic/tclGetDate.y: Fixed a thread safety bug in the generated
* library/clock.tcl: Bison parser (needed a %pure-parser * tests/clock.test: declaration to avoid static variables). Discovered that the %pure-parser declaration allowed for returning the Bison error message to the Tcl caller in the event of a syntax error, so did so. * generic/tclDate.c: bison 2.3
Diffstat (limited to 'tests/clock.test')
-rw-r--r--tests/clock.test43
1 files changed, 39 insertions, 4 deletions
diff --git a/tests/clock.test b/tests/clock.test
index 7eb1b25..0f1e9da 100644
--- a/tests/clock.test
+++ b/tests/clock.test
@@ -11,7 +11,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.90 2009/01/03 04:38:12 kennykb Exp $
+# RCS: @(#) $Id: clock.test,v 1.91 2009/06/09 13:52:38 kennykb Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -35578,9 +35578,12 @@ test clock-33.11a {clock test, millis align with micros} {
test clock-34.1 {clock scan tests} {
list [catch {clock scan} msg] $msg
} {1 {wrong # args: should be "clock scan string ?-base seconds? ?-format string? ?-gmt boolean? ?-locale LOCALE? ?-timezone ZONE?"}}
-test clock-34.2 {clock scan tests} {
- list [catch {clock scan "bad-string"} msg] $msg
-} {1 {unable to convert date-time string "bad-string"}}
+test clock-34.2 {clock scan tests} {*}{
+ -body {clock scan "bad-string"}
+ -returnCodes error
+ -match glob
+ -result {unable to convert date-time string "bad-string"*}
+}
test clock-34.3 {clock scan tests} {
clock format [clock scan "14 Feb 92" -gmt true] \
-format {%m/%d/%y %I:%M:%S %p} -gmt true
@@ -35804,6 +35807,38 @@ test clock-34.47 {ago with multiple relative units} {
expr {$base - $res}
} 180000
+test clock-34.48 {more than one ToD} {*}{
+ -body {clock scan {10:00 11:00}}
+ -returnCodes error
+ -result {unable to convert date-time string "10:00 11:00": more than one time of day in string}
+}
+
+test clock-34.49 {more than one date} {*}{
+ -body {clock scan {1/1/2001 2/2/2002}}
+ -returnCodes error
+ -result {unable to convert date-time string "1/1/2001 2/2/2002": more than one date in string}
+}
+
+test clock-34.50 {more than one time zone} {*}{
+ -body {clock scan {10:00 EST CST}}
+ -returnCodes error
+ -result {unable to convert date-time string "10:00 EST CST": more than one time zone in string}
+}
+
+test clock-34.51 {more than one weekday} {*}{
+ -body {clock scan {Monday Tuesday}}
+ -returnCodes error
+ -result {unable to convert date-time string "Monday Tuesday": more than one weekday in string}
+}
+
+test clock-34.52 {more than one ordinal month} {*}{
+ -body {clock scan {next January next March}}
+ -returnCodes error
+ -result {unable to convert date-time string "next January next March": more than one ordinal month in string}
+}
+
+
+
# clock seconds
test clock-35.1 {clock seconds tests} {
expr [clock seconds]+1