diff options
author | hobbs <hobbs@noemail.net> | 2002-11-19 02:34:48 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2002-11-19 02:34:48 (GMT) |
commit | 37a7c7abde6c9f7aac56e9a325dc525869b3a0ca (patch) | |
tree | 504abe4bc769d428863271620704ff919b9629b9 /tests/string.test | |
parent | 1f46bc5c72b2183d19993e99562b8ec32b90dc6f (diff) | |
download | tcl-37a7c7abde6c9f7aac56e9a325dc525869b3a0ca.zip tcl-37a7c7abde6c9f7aac56e9a325dc525869b3a0ca.tar.gz tcl-37a7c7abde6c9f7aac56e9a325dc525869b3a0ca.tar.bz2 |
* generic/tclUtil.c (SetEndOffsetFromAny): handle integer offset
after the "end-" prefix.
* generic/get.test:
* generic/string.test:
* generic/tclObj.c (SetIntFromAny, SetWideIntFromAny):
* generic/tclGet.c (TclGetLong, Tcl_GetInt): simplify sign
handling before calling strtoul(l). [Bug #634856]
FossilOrigin-Name: 9ed60484106be0df1d59f7a63c433c7e7e957725
Diffstat (limited to 'tests/string.test')
-rw-r--r-- | tests/string.test | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/string.test b/tests/string.test index d2bdb6d..bffb623 100644 --- a/tests/string.test +++ b/tests/string.test @@ -12,7 +12,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: string.test,v 1.34 2002/05/29 09:09:00 hobbs Exp $ +# RCS: @(#) $Id: string.test,v 1.35 2002/11/19 02:34:50 hobbs Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -574,6 +574,24 @@ test string-6.89 {string is xdigit} { list [string is xdigit -fail var 0123456789\u0061bcdefABCDEFg] $var } {0 22} +test string-6.90 {string is integer, bad integers} { + # SF bug #634856 + set result "" + set numbers [list 1 +1 ++1 +-1 -+1 -1 --1 "- +1"] + foreach num $numbers { + lappend result [string is int -strict $num] + } + set result +} {1 1 0 0 0 1 0 0} +test string-6.91 {string is double, bad doubles} { + set result "" + set numbers [list 1.0 +1.0 ++1.0 +-1.0 -+1.0 -1.0 --1.0 "- +1.0"] + foreach num $numbers { + lappend result [string is double -strict $num] + } + set result +} {1 1 0 0 0 1 0 0} + catch {rename largest_int {}} test string-7.1 {string last, too few args} { |