diff options
Diffstat (limited to 'tests/clock.test')
-rw-r--r-- | tests/clock.test | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/tests/clock.test b/tests/clock.test index 257b5bd..c36f5fe 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.82 2008/02/06 01:13:07 kennykb Exp $ +# RCS: @(#) $Id: clock.test,v 1.83 2008/02/27 02:08:27 kennykb Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -36592,6 +36592,42 @@ test clock-60.12 {case insensitive month names} { clock scan "1 DECEMBER 2000" -gmt true -format "%d %b %Y" } [clock scan "2000-12-01" -gmt true -format "%Y-%m-%d"] +test clock-61.1 {overflow of a wide integer on output} {*}{ + -body { + clock format 0x8000000000000000 -format %s -gmt true + } + -result {integer value too large to represent} + -returnCodes error +} +test clock-61.2 {overflow of a wide integer on output} {*}{ + -body { + clock format -0x8000000000000001 -format %s -gmt true + } + -result {integer value too large to represent} + -returnCodes error +} +test clock-61.3 {near-miss overflow of a wide integer on output} { + clock format 0x7fffffffffffffff -format %s -gmt true +} [expr 0x7fffffffffffffff] +test clock-61.4 {near-miss overflow of a wide integer on output} { + clock format -0x8000000000000000 -format %s -gmt true +} [expr -0x8000000000000000] + +test clock-62.1 {Bug 1902423} {*}{ + -setup {::tcl::clock::ClearCaches} + -body { + set s 1204049747 + set f1 [clock format $s -format {%Y-%m-%d %T} -locale C] + set f2 [clock format $s -format {%Y-%m-%d %H:%M:%S} -locale C] + if {$f1 ne $f2} { + subst "$f2 is not $f1" + } else { + subst "ok" + } + } + -result ok +} + # cleanup namespace delete ::testClock |