diff options
author | sebres <sebres@users.sourceforge.net> | 2024-04-06 13:48:46 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2024-04-06 13:48:46 (GMT) |
commit | 03a2d33363262ebd29de7e7bf86485b068488883 (patch) | |
tree | 98f01ca9265d25be179e17b9d2df30942b1ed750 /tests/clock.test | |
parent | 1b7781fb7a474673afe2e57dadd909a6ff7eb65d (diff) | |
download | tcl-03a2d33363262ebd29de7e7bf86485b068488883.zip tcl-03a2d33363262ebd29de7e7bf86485b068488883.tar.gz tcl-03a2d33363262ebd29de7e7bf86485b068488883.tar.bz2 |
more improvements for overflow cases (always proper message, errorCode, correct badOption value)
Diffstat (limited to 'tests/clock.test')
-rw-r--r-- | tests/clock.test | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/tests/clock.test b/tests/clock.test index b966666..3a43017 100644 --- a/tests/clock.test +++ b/tests/clock.test @@ -38184,14 +38184,32 @@ test clock-61.1 {overflow of a wide integer on output} {*}{ -body { clock format 0x8000000000000000 -format %s -gmt true } - -result {expected integer but got "0x8000000000000000"} + -result {integer value too large to represent} + -errorCode {CLOCK badOption 0x8000000000000000} + -returnCodes error +} +test clock-61.1b {overflow of a wide integer on base} {*}{ + -body { + clock scan "" -base 0x8000000000000000 -gmt true + } + -result {integer value too large to represent} + -errorCode {CLOCK badOption 0x8000000000000000} -returnCodes error } test clock-61.2 {overflow of a wide integer on output} {*}{ -body { clock format -0x8000000000000001 -format %s -gmt true } - -result {expected integer but got "-0x8000000000000001"} + -result {integer value too large to represent} + -errorCode {CLOCK badOption -0x8000000000000001} + -returnCodes error +} +test clock-61.2b {overflow of a wide integer on base} {*}{ + -body { + clock scan "" -base -0x8000000000000001 -gmt true + } + -result {integer value too large to represent} + -errorCode {CLOCK badOption -0x8000000000000001} -returnCodes error } test clock-61.3 {near-miss overflow of a wide integer on output, very large datetime (upper range)} { @@ -38203,10 +38221,10 @@ test clock-61.4 {near-miss overflow of a wide integer on output, very small date test clock-61.5 {overflow of possible date-time (upper range)} -body { clock format 0x00F0000000000001 -gmt true -} -returnCodes error -result {integer value too large to represent} +} -returnCodes error -result {integer value too large to represent} -errorCode {CLOCK badOption 0x00F0000000000001} test clock-61.6 {overflow of possible date-time (lower range)} -body { clock format -0x00F0000000000001 -gmt true -} -returnCodes error -result {integer value too large to represent} +} -returnCodes error -result {integer value too large to represent} -errorCode {CLOCK badOption -0x00F0000000000001} test clock-62.1 {Bug 1902423} {*}{ -setup {::tcl::clock::ClearCaches} |