diff options
author | jenn <jenn@noemail.net> | 1999-08-27 01:17:01 (GMT) |
---|---|---|
committer | jenn <jenn@noemail.net> | 1999-08-27 01:17:01 (GMT) |
commit | 4751a12474e7f88dc79cea1dfe822ca8ab8196d2 (patch) | |
tree | 6ae58e358e0f7740049d30a1d2e5db4aa0c8bda0 /tests/tcltest.test | |
parent | c82e0aa6b2f799050ac9fe2a96665412994f211d (diff) | |
download | tcl-4751a12474e7f88dc79cea1dfe822ca8ab8196d2.zip tcl-4751a12474e7f88dc79cea1dfe822ca8ab8196d2.tar.gz tcl-4751a12474e7f88dc79cea1dfe822ca8ab8196d2.tar.bz2 |
* tests/tcltest.test:
* library/tcltest1.0/tcltest.tcl: Added a -args flag that sets a
variable named ::tcltest::parameters based on whatever's being
sent in as the argument to the -args flag.
FossilOrigin-Name: 03b5b8d2c0bd23c086719191cab1bb3afb5a7c7c
Diffstat (limited to 'tests/tcltest.test')
-rwxr-xr-x | tests/tcltest.test | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/tests/tcltest.test b/tests/tcltest.test index 855e433..b87b830 100755 --- a/tests/tcltest.test +++ b/tests/tcltest.test @@ -1,7 +1,7 @@ # Command line options covered: # -help, -verbose, -match, -skip, -file, -notfile, -constraints, # -limitconstraints, -preservecore, -tmpdir, -debug, -outfile, -# -errfile +# -errfile, -args # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and @@ -10,7 +10,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: tcltest.test,v 1.6 1999/08/23 17:54:59 jenn Exp $ +# RCS: @(#) $Id: tcltest.test,v 1.7 1999/08/27 01:17:06 jenn Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -323,10 +323,33 @@ test tcltest-10.4 {-preservecore 3} {unixOrPc} { [regexp "core-" $msg] [file delete core-makecore] } {1 1 1 {}} +makeFile { + package require tcltest + namespace import ::tcltest::* + puts "=$::tcltest::parameters=" + return +} args.tcl + +# -args +test tcltest-11.1 {-args foo} {unixOrPc} { + catch {exec $::tcltest::tcltest args.tcl -args foo} msg + list $msg +} {=foo=} + +test tcltest-11.2 {-args {}} {unixOrPc} { + catch {exec $::tcltest::tcltest args.tcl -args {}} msg + list $msg +} {==} + +test tcltest-11.3 {-args {-foo bar -baz}} {unixOrPc} { + catch {exec $::tcltest::tcltest args.tcl -args {-foo bar -baz}} msg + list $msg +} {{=-foo bar -baz=}} + # Begin testing of tcltest procs ... # PrintError -test tcltest-11.1 {PrintError} {unixOrPc} { +test tcltest-20.1 {PrintError} {unixOrPc} { set result [catch {exec $::tcltest::tcltest printerror.tcl} msg] list $result [regexp "Error: a really short string" $msg] \ [regexp " \"quotes\"" $msg] [regexp " \"Path" $msg] \ |