diff options
author | Kevin B Kenny <kennykb@acm.org> | 2009-06-09 13:52:58 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2009-06-09 13:52:58 (GMT) |
commit | 84b4642f23e9ce612ea65bb135c9ffadfe21352d (patch) | |
tree | 03dfbf68bc437cb16e8388c65e7bcc12cd0f030d /tests | |
parent | 78c6dc0737b02640bdefa7f048a3ae3ad50fc725 (diff) | |
download | tcl-84b4642f23e9ce612ea65bb135c9ffadfe21352d.zip tcl-84b4642f23e9ce612ea65bb135c9ffadfe21352d.tar.gz tcl-84b4642f23e9ce612ea65bb135c9ffadfe21352d.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')
-rw-r--r-- | tests/clock.test | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/tests/clock.test b/tests/clock.test index c58ac0e..6af7134 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.83.2.5 2009/01/03 04:36:53 kennykb Exp $ +# RCS: @(#) $Id: clock.test,v 1.83.2.6 2009/06/09 13:52:58 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 |