diff options
Diffstat (limited to 'tests/clock.test')
-rw-r--r-- | tests/clock.test | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/clock.test b/tests/clock.test index d0192cd..1b1632f 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.4 1999/06/26 03:54:10 jenn Exp $ +# RCS: @(#) $Id: clock.test,v 1.5 1999/09/21 04:20:44 hobbs Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -30,14 +30,25 @@ test clock-2.1 {clock clicks tests} { concat {} } {} test clock-2.2 {clock clicks tests} { - list [catch {clock clicks foo} msg] $msg -} {1 {wrong # args: should be "clock clicks"}} -test clock-2.3 {clock clicks tests} { set start [clock clicks] after 10 set end [clock clicks] expr "$end > $start" } {1} +test clock-2.3 {clock clicks tests} { + list [catch {clock clicks foo} msg] $msg +} {1 {bad switch "foo": must be -milliseconds}} +test clock-2.3 {clock clicks tests} { + expr [clock clicks -milliseconds]+1 + concat {} +} {} +test clock-2.2 {clock clicks tests, millisecond timing test} { + set start [clock clicks -milli] + after 10 + set end [clock clicks -milli] + # assume, even with slow interp'ing, the diff is less than 60 msecs + expr {($end > $start) && (($end - $start) < 60)} +} {1} # clock format test clock-3.1 {clock format tests} {unixOnly} { |