diff options
Diffstat (limited to 'tests/proc-old.test')
-rw-r--r-- | tests/proc-old.test | 40 |
1 files changed, 14 insertions, 26 deletions
diff --git a/tests/proc-old.test b/tests/proc-old.test index 71558cf..5aec4f7 100644 --- a/tests/proc-old.test +++ b/tests/proc-old.test @@ -231,7 +231,7 @@ test proc-old-30.12 {arguments and defaults} { return [list $x $y $args] } list [catch {tproc} msg] $msg -} {1 {wrong # args: should be "tproc x ?y? args"}} +} {1 {wrong # args: should be "tproc x ?y? ..."}} test proc-old-4.1 {variable numbers of arguments} { proc tproc args {return $args} @@ -256,7 +256,7 @@ test proc-old-4.5 {variable numbers of arguments} { test proc-old-4.6 {variable numbers of arguments} { proc tproc {x missing args} {return $args} list [catch {tproc 1} msg] $msg -} {1 {wrong # args: should be "tproc x missing args"}} +} {1 {wrong # args: should be "tproc x missing ..."}} test proc-old-5.1 {error conditions} { list [catch {proc} msg] $msg @@ -272,10 +272,10 @@ test proc-old-5.4 {error conditions} { } {1 {unmatched open brace in list}} test proc-old-5.5 {error conditions} { list [catch {proc tproc {{} y} {return foo}} msg] $msg -} {1 {procedure "tproc" has argument with no name}} +} {1 {argument with no name}} test proc-old-5.6 {error conditions} { list [catch {proc tproc {{} y} {return foo}} msg] $msg -} {1 {procedure "tproc" has argument with no name}} +} {1 {argument with no name}} test proc-old-5.7 {error conditions} { list [catch {proc tproc {{x 1 2} y} {return foo}} msg] $msg } {1 {too many fields in argument specifier "x 1 2"}} @@ -314,7 +314,7 @@ test proc-old-5.13 {error conditions} { return } catch tproc msg - set errorInfo + set ::errorInfo } {error in procedure while executing "error "error in procedure"" @@ -328,7 +328,7 @@ test proc-old-5.14 {error conditions} { return } catch tproc msg - set errorInfo + set ::errorInfo } {invoked "break" outside of a loop (procedure "tproc" line 1) invoked from within @@ -340,7 +340,7 @@ test proc-old-5.15 {error conditions} { return } catch tproc msg - set errorInfo + set ::errorInfo } {invoked "continue" outside of a loop (procedure "tproc" line 1) invoked from within @@ -358,7 +358,7 @@ test proc-old-5.16 {error conditions} { } } set fooMsg "foo not called" - list [catch tproc msg] $msg $errorInfo $fooMsg + list [catch tproc msg] $msg $::errorInfo $fooMsg } {1 {Nested error} {Nested error while executing "error "Nested error"" @@ -393,7 +393,7 @@ test proc-old-7.1 {return with special completion code} { list [catch {tproc ok} msg] $msg } {0 abc} test proc-old-7.2 {return with special completion code} { - list [catch {tproc error} msg] $msg $errorInfo $errorCode + list [catch {tproc error} msg] $msg $::errorInfo $::errorCode } {1 abc {abc while executing "tproc error"} NONE} @@ -433,7 +433,7 @@ test proc-old-7.11 {return with special completion code} { catch {open _bad_file_name r} msg return -code error -errorinfo $errorInfo -errorcode $errorCode $msg } - set msg [list [catch tproc2 msg] $msg $errorInfo $errorCode] + set msg [list [catch tproc2 msg] $msg $::errorInfo $::errorCode] regsub -all [file join {} _bad_file_name] $msg "_bad_file_name" msg normalizeMsg $msg } {1 {couldn't open "_bad_file_name": no such file or directory} {couldn't open "_bad_file_name": no such file or directory @@ -447,7 +447,7 @@ test proc-old-7.12 {return with special completion code} { catch {open _bad_file_name r} msg return -code error -errorcode $errorCode $msg } - set msg [list [catch tproc2 msg] $msg $errorInfo $errorCode] + set msg [list [catch tproc2 msg] $msg $::errorInfo $::errorCode] regsub -all [file join {} _bad_file_name] $msg "_bad_file_name" msg normalizeMsg $msg } {1 {couldn't open "_bad_file_name": no such file or directory} {couldn't open "_bad_file_name": no such file or directory @@ -459,7 +459,7 @@ test proc-old-7.13 {return with special completion code} { catch {open _bad_file_name r} msg return -code error -errorinfo $errorInfo $msg } - set msg [list [catch tproc2 msg] $msg $errorInfo $errorCode] + set msg [list [catch tproc2 msg] $msg $::errorInfo $::errorCode] regsub -all [file join {} _bad_file_name] $msg "_bad_file_name" msg normalizeMsg $msg } {1 {couldn't open "_bad_file_name": no such file or directory} {couldn't open "_bad_file_name": no such file or directory @@ -473,7 +473,7 @@ test proc-old-7.14 {return with special completion code} { catch {open _bad_file_name r} msg return -code error $msg } - set msg [list [catch tproc2 msg] $msg $errorInfo $errorCode] + set msg [list [catch tproc2 msg] $msg $::errorInfo $::errorCode] regsub -all [file join {} _bad_file_name] $msg "_bad_file_name" msg normalizeMsg $msg } {1 {couldn't open "_bad_file_name": no such file or directory} {couldn't open "_bad_file_name": no such file or directory @@ -481,7 +481,7 @@ test proc-old-7.14 {return with special completion code} { "tproc2"} none} test proc-old-7.15 {return with special completion code} { list [catch {return -badOption foo message} msg] $msg -} {1 {bad option "-badOption": must be -code, -errorcode, or -errorinfo}} +} {2 message} test proc-old-8.1 {unset and undefined local arrays} { proc t1 {} { @@ -518,15 +518,3 @@ catch {rename t1 ""} catch {rename foo ""} ::tcltest::cleanupTests return - - - - - - - - - - - - |