diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-03-22 13:42:19 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-03-22 13:42:19 (GMT) |
| commit | 3d6756d59c08d001aaa8a2d778feaa4ce57e938b (patch) | |
| tree | 4887a355e1dd9e87fb9ae174eb1ae897c884101f | |
| parent | 0d615819b7678c25b7da29c7218b56f8ce8052d7 (diff) | |
| parent | d7ec31013a808f22ead867f83d5d8ddad36d7826 (diff) | |
| download | tcl-3d6756d59c08d001aaa8a2d778feaa4ce57e938b.zip tcl-3d6756d59c08d001aaa8a2d778feaa4ce57e938b.tar.gz tcl-3d6756d59c08d001aaa8a2d778feaa4ce57e938b.tar.bz2 | |
Merge 8.7
| -rw-r--r-- | library/clock.tcl | 2 | ||||
| -rw-r--r-- | tests/clock.test | 24 |
2 files changed, 21 insertions, 5 deletions
diff --git a/library/clock.tcl b/library/clock.tcl index b468fea..d80fb2f 100644 --- a/library/clock.tcl +++ b/library/clock.tcl @@ -2683,7 +2683,7 @@ proc ::tcl::clock::ScanWide { str } { "\"$str\" is not an integer" } if { [incr result 0] != $str } { - return -code error -errorcode [list CLOCK integervalueTooLarge] \ + return -code error -errorcode [list CLOCK dateTooLarge] \ "integer value too large to represent" } return $result diff --git a/tests/clock.test b/tests/clock.test index 189b83a..7cb86a3 100644 --- a/tests/clock.test +++ b/tests/clock.test @@ -18532,12 +18532,28 @@ test clock-6.8 {input of seconds} { } 9223372036854775807 test clock-6.9 {input of seconds - overflow} { - list [catch {clock scan -9223372036854775809 -format %s -gmt true} result] $result -} {1 {integer value too large to represent}} + list [catch {clock scan -9223372036854775809 -format %s -gmt true} result] $result $::errorCode +} {1 {integer value too large to represent} {CLOCK dateTooLarge}} test clock-6.10 {input of seconds - overflow} { - list [catch {clock scan 9223372036854775808 -format %s -gmt true} result] $result -} {1 {integer value too large to represent}} + list [catch {clock scan 9223372036854775808 -format %s -gmt true} result] $result $::errorCode +} {1 {integer value too large to represent} {CLOCK dateTooLarge}} + +test clock-6.10a {input of seconds - overflow, bug [1f40aa83c5]} { + list [catch {clock scan 27670116110564327423 -format %s -gmt true} result] $result $::errorCode +} {1 {integer value too large to represent} {CLOCK dateTooLarge}} + +test clock-6.10b {input of seconds - overflow ??, bug [1f40aa83c5]} knownBug { + clock scan 27670116110564327423 -gmt true +} 89170590268800 + +test clock-6.10c {input of seconds - overflow, bug [1f40aa83c5]} { + list [catch {clock scan 27670116110564327424 -format %s -gmt true} result] $result $::errorCode +} {1 {integer value too large to represent} {CLOCK dateTooLarge}} + +test clock-6.10d {input of seconds - overflow ??, bug [1f40aa83c5]} knownBug { + clock scan 27670116110564327424 -gmt true +} -90247104115200 test clock-6.11 {input of seconds - two values} { clock scan {1 2} -format {%s %s} -gmt true |
