diff options
author | dgp <dgp@users.sourceforge.net> | 2007-10-15 21:27:47 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2007-10-15 21:27:47 (GMT) |
commit | 7222d685f8f460bfd8edb01515a8d6ad5e5c60a3 (patch) | |
tree | 660da6ea51654bcc0e6047863d9213d28f2694a4 /tests/lindex.test | |
parent | 03bf8aafa026b3996c8907876f76f3b43d77da04 (diff) | |
download | tcl-7222d685f8f460bfd8edb01515a8d6ad5e5c60a3.zip tcl-7222d685f8f460bfd8edb01515a8d6ad5e5c60a3.tar.gz tcl-7222d685f8f460bfd8edb01515a8d6ad5e5c60a3.tar.bz2 |
* generic/tclIOCmd.c: Revise [open] so that it interprets leading
zero strings passed as the "permissions" argument as octal numbers,
even if Tcl itself no longer parses integers in that way.
* unix/tclUnixFCmd.c: Revise the "-permissions" [file attribute] so
that it interprets leading zero strings as octal numbers, even if Tcl
itself no longer parses integers in that way.
* generic/tclCompExpr.c: Corrections to code that produces
* generic/tclUtil.c: extended "bad octal" error messages.
* tests/cmdAH.test: Test revisions so that tests pass whether or
* tests/cmdIL.test: not Tcl parses leading zero strings as octal.
* tests/compExpr-old.test:
* tests/compExpr.test:
* tests/compile.test:
* tests/expr-old.test:
* tests/expr.test:
* tests/incr.test:
* tests/io.test:
* tests/lindex.test:
* tests/link.test:
* tests/mathop.test:
* tests/parseExpr.test:
* tests/set.test:
* tests/string.test:
* tests/stringComp.test:
Diffstat (limited to 'tests/lindex.test')
-rw-r--r-- | tests/lindex.test | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/tests/lindex.test b/tests/lindex.test index 37c840e..baaf73a 100644 --- a/tests/lindex.test +++ b/tests/lindex.test @@ -12,10 +12,10 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: lindex.test,v 1.15 2007/09/03 21:27:22 kennykb Exp $ +# RCS: @(#) $Id: lindex.test,v 1.16 2007/10/15 21:27:50 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { - package require tcltest + package require tcltest 2.2 namespace import -force ::tcltest::* } @@ -66,14 +66,14 @@ test lindex-3.4 {integer 3} testevalex { set x [string range 33 0 0] list [testevalex {lindex {a b c} $x}] [testevalex {lindex {a b c} $x}] } {{} {}} -test lindex-3.5 {bad octal} testevalex { - set x 08 +test lindex-3.5 {bad octal} -constraints testevalex -body { + set x 0o8 list [catch { testevalex {lindex {a b c} $x} } result] $result -} {1 {bad index "08": must be integer?[+-]integer? or end?[+-]integer? (looks like invalid octal number)}} -test lindex-3.6 {bad octal} testevalex { - set x -09 +} -match glob -result {1 {*invalid octal number*}} +test lindex-3.6 {bad octal} -constraints testevalex -body { + set x -0o9 list [catch { testevalex {lindex {a b c} $x} } result] $result -} {1 {bad index "-09": must be integer?[+-]integer? or end?[+-]integer? (looks like invalid octal number)}} +} -match glob -result {1 {*invalid octal number*}} test lindex-3.7 {indexes don't shimmer wide ints} { set x [expr {(wide(1)<<31) - 2}] list $x [lindex {1 2 3} $x] [incr x] [incr x] @@ -101,14 +101,14 @@ test lindex-4.5 {index = end-3} testevalex { set x end-3 list [testevalex {lindex {a b c} $x}] [testevalex {lindex {a b c} $x}] } {{} {}} -test lindex-4.6 {bad octal} testevalex { - set x end-08 +test lindex-4.6 {bad octal} -constraints testevalex -body { + set x end-0o8 list [catch { testevalex {lindex {a b c} $x} } result] $result -} {1 {bad index "end-08": must be integer?[+-]integer? or end?[+-]integer? (looks like invalid octal number)}} -test lindex-4.7 {bad octal} testevalex { - set x end--09 +} -match glob -result {1 {*invalid octal number*}} +test lindex-4.7 {bad octal} -constraints testevalex -body { + set x end--0o9 list [catch { testevalex {lindex {a b c} $x} } result] $result -} {1 {bad index "end--09": must be integer?[+-]integer? or end?[+-]integer?}} +} -match glob -result {1 {*invalid octal number*}} test lindex-4.8 {bad integer, not octal} testevalex { set x end-0a2 list [catch { testevalex {lindex {a b c} $x} } result] $result @@ -257,14 +257,14 @@ test lindex-11.4 {integer 3} { } result set result } {{} {}} -test lindex-11.5 {bad octal} { - set x 08 +test lindex-11.5 {bad octal} -body { + set x 0o8 list [catch { lindex {a b c} $x } result] $result -} {1 {bad index "08": must be integer?[+-]integer? or end?[+-]integer? (looks like invalid octal number)}} -test lindex-11.6 {bad octal} { - set x -09 +} -match glob -result {1 {*invalid octal number*}} +test lindex-11.6 {bad octal} -body { + set x -0o9 list [catch { lindex {a b c} $x } result] $result -} {1 {bad index "-09": must be integer?[+-]integer? or end?[+-]integer? (looks like invalid octal number)}} +} -match glob -result {1 {*invalid octal number*}} # Indices relative to end @@ -303,14 +303,14 @@ test lindex-12.5 {index = end-3} { } result set result } {{} {}} -test lindex-12.6 {bad octal} { - set x end-08 +test lindex-12.6 {bad octal} -body { + set x end-0o8 list [catch { lindex {a b c} $x } result] $result -} {1 {bad index "end-08": must be integer?[+-]integer? or end?[+-]integer? (looks like invalid octal number)}} -test lindex-12.7 {bad octal} { - set x end--09 +} -match glob -result {1 {*invalid octal number*}} +test lindex-12.7 {bad octal} -body { + set x end--0o9 list [catch { lindex {a b c} $x } result] $result -} {1 {bad index "end--09": must be integer?[+-]integer? or end?[+-]integer?}} +} -match glob -result {1 {*invalid octal number*}} test lindex-12.8 {bad integer, not octal} { set x end-0a2 list [catch { lindex {a b c} $x } result] $result |