diff options
author | hobbs <hobbs> | 2000-05-03 00:14:35 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2000-05-03 00:14:35 (GMT) |
commit | 4c8a9811534a3b4a2a4f18a8b336e32f09924f99 (patch) | |
tree | 5628ff7c339091fc70acb302e1df79ed6a1940e9 /tests/proc-old.test | |
parent | c976f22afb9a851655b7dca553a0ff0dff4175ac (diff) | |
download | tcl-4c8a9811534a3b4a2a4f18a8b336e32f09924f99.zip tcl-4c8a9811534a3b4a2a4f18a8b336e32f09924f99.tar.gz tcl-4c8a9811534a3b4a2a4f18a8b336e32f09924f99.tar.bz2 |
* tests/compile.test:
* tests/init.test:
* tests/proc.test:
* tests/proc-old.test:
* tests/rename.test:
* generic/tclProc.c: reworked error return for procedures with
incorrect args to be like the C Tcl_WrongNumArgs, where a "wrong #
args: ..." message is printed out with the args list.
Diffstat (limited to 'tests/proc-old.test')
-rw-r--r-- | tests/proc-old.test | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/tests/proc-old.test b/tests/proc-old.test index f139f8c..9365042 100644 --- a/tests/proc-old.test +++ b/tests/proc-old.test @@ -14,7 +14,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: proc-old.test,v 1.6 2000/04/10 17:19:03 ericm Exp $ +# RCS: @(#) $Id: proc-old.test,v 1.7 2000/05/03 00:14:36 hobbs Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -160,80 +160,80 @@ test proc-old-3.9 {local and global arrays} { } {{w t1}} catch {unset a} -test proc-old-3.1 {arguments and defaults} { +test proc-old-30.1 {arguments and defaults} { proc tproc {x y z} { return [list $x $y $z] } tproc 11 12 13 } {11 12 13} -test proc-old-3.2 {arguments and defaults} { +test proc-old-30.2 {arguments and defaults} { proc tproc {x y z} { return [list $x $y $z] } list [catch {tproc 11 12} msg] $msg -} {1 {no value given for parameter "z" to "tproc"}} -test proc-old-3.3 {arguments and defaults} { +} {1 {wrong # args: should be "tproc x y z"}} +test proc-old-30.3 {arguments and defaults} { proc tproc {x y z} { return [list $x $y $z] } list [catch {tproc 11 12 13 14} msg] $msg -} {1 {called "tproc" with too many arguments}} -test proc-old-3.4 {arguments and defaults} { +} {1 {wrong # args: should be "tproc x y z"}} +test proc-old-30.4 {arguments and defaults} { proc tproc {x {y y-default} {z z-default}} { return [list $x $y $z] } tproc 11 12 13 } {11 12 13} -test proc-old-3.5 {arguments and defaults} { +test proc-old-30.5 {arguments and defaults} { proc tproc {x {y y-default} {z z-default}} { return [list $x $y $z] } tproc 11 12 } {11 12 z-default} -test proc-old-3.6 {arguments and defaults} { +test proc-old-30.6 {arguments and defaults} { proc tproc {x {y y-default} {z z-default}} { return [list $x $y $z] } tproc 11 } {11 y-default z-default} -test proc-old-3.7 {arguments and defaults} { +test proc-old-30.7 {arguments and defaults} { proc tproc {x {y y-default} {z z-default}} { return [list $x $y $z] } list [catch {tproc} msg] $msg -} {1 {no value given for parameter "x" to "tproc"}} -test proc-old-3.8 {arguments and defaults} { +} {1 {wrong # args: should be "tproc x ?y? ?z?"}} +test proc-old-30.8 {arguments and defaults} { list [catch { proc tproc {x {y y-default} z} { return [list $x $y $z] } tproc 2 3 } msg] $msg -} {1 {no value given for parameter "z" to "tproc"}} -test proc-old-3.9 {arguments and defaults} { +} {1 {wrong # args: should be "tproc x ?y? z"}} +test proc-old-30.9 {arguments and defaults} { proc tproc {x {y y-default} args} { return [list $x $y $args] } tproc 2 3 4 5 } {2 3 {4 5}} -test proc-old-3.10 {arguments and defaults} { +test proc-old-30.10 {arguments and defaults} { proc tproc {x {y y-default} args} { return [list $x $y $args] } tproc 2 3 } {2 3 {}} -test proc-old-3.11 {arguments and defaults} { +test proc-old-30.11 {arguments and defaults} { proc tproc {x {y y-default} args} { return [list $x $y $args] } tproc 2 } {2 y-default {}} -test proc-old-3.12 {arguments and defaults} { +test proc-old-30.12 {arguments and defaults} { proc tproc {x {y y-default} args} { return [list $x $y $args] } list [catch {tproc} msg] $msg -} {1 {no value given for parameter "x" to "tproc"}} +} {1 {wrong # args: should be "tproc x ?y? args"}} test proc-old-4.1 {variable numbers of arguments} { proc tproc args {return $args} @@ -258,7 +258,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 {no value given for parameter "missing" to "tproc"}} +} {1 {wrong # args: should be "tproc x missing args"}} test proc-old-5.1 {error conditions} { list [catch {proc} msg] $msg |