Skip to content

Commit

Permalink
All these tests at least parse now, run them all, TODO'ing where needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
coke committed Apr 13, 2010
1 parent 07b1f3f commit 290c08d
Show file tree
Hide file tree
Showing 11 changed files with 105 additions and 99 deletions.
24 changes: 15 additions & 9 deletions build/Makefile.in
Expand Up @@ -59,12 +59,21 @@ TEST_FILES = \
t/sanity.t \
t/cmd_after.t \
t/cmd_append.t \
t/cmd_apply.t \
t/cmd_array.t \
t/cmd_break.t \
t/cmd_catch.t \
t/cmd_concat.t \
t/cmd_continue.t \
t/cmd_eof.t \
t/cmd_error.t \
t/cmd_eval.t \
t/cmd_file.t \
t/cmd_flush.t \
t/cmd_for.t \
t/cmd_foreach.t \
t/cmd_global.t \
t/cmd_if.t \
t/cmd_incr.t \
t/cmd_join.t \
t/cmd_lappend.t \
Expand All @@ -82,6 +91,7 @@ TEST_FILES = \
t/cmd_set.t \
t/cmd_split.t \
t/cmd_string.t \
t/cmd_switch.t \
t/cmd_time.t \
t/cmd_while.t \
t/tcl_backslash.t \
Expand All @@ -91,15 +101,11 @@ TEST_FILES = \

# These t/*.t files are not yet runnable. Keep a list around so we know
# what to work on.
# t/cmd_apply.t t/cmd_array.t t/cmd_binary.t t/cmd_break.t
# t/cmd_catch.t t/cmd_continue.t t/cmd_eval.t t/cmd_expr.t t/cmd_file.t
# t/cmd_fileevent.t t/cmd_format.t t/cmd_gets.t
# t/cmd_global.t t/cmd_if.t t/cmd_info.t
# t/cmd_lsort.t t/cmd_namespace.t
# t/cmd_proc.t t/cmd_regexp.t t/cmd_socket.t
# t/cmd_subst.t t/cmd_switch.t t/cmd_trace.t t/cmd_unset.t t/cmd_upvar.t
# t/cmd_variable.t t/cmd_vwait.t
# t/tcl_misc.t t/tcl_namespace.t t/tcl_var_subst.t
# t/cmd_binary.t t/cmd_expr.t t/cmd_fileevent.t t/cmd_format.t t/cmd_gets.t
# t/cmd_info.t t/cmd_lsort.t t/cmd_namespace.t t/cmd_proc.t t/cmd_regexp.t
# t/cmd_socket.t t/cmd_subst.t t/cmd_trace.t t/cmd_unset.t t/cmd_upvar.t
# t/cmd_variable.t t/cmd_vwait.t t/tcl_misc.t t/tcl_namespace.t
# t/tcl_var_subst.t

Makefile: Configure.pl build/Makefile.in
$(PERL) Configure.pl
Expand Down
14 changes: 7 additions & 7 deletions t/cmd_apply.t
Expand Up @@ -6,30 +6,30 @@ plan 8

eval_is {apply foo} \
{can't interpret "foo" as a lambda expression} \
{bad lambda expression}
{bad lambda expression} {TODO NQPRX}

eval_is {apply {foo bar baz bit}} \
{can't interpret "foo bar baz bit" as a lambda expression} \
{bad lamdba expression}
{bad lamdba expression} {TODO NQPRX}

eval_is {apply {foo bar baz}} \
{namespace "::baz" not found} \
{namespace doesn't exist}
{namespace doesn't exist} {TODO NQPRX}

eval_is {apply} \
{wrong # args: should be "apply lambdaExpr ?arg1 arg2 ...?"} \
{too few args}

eval_is {apply {{foo {bar 2} {baz 3}} bar}} \
{wrong # args: should be "apply {{foo {bar 2} {baz 3}} bar} foo ?bar? ?baz?"} \
{too few args}
{too few args} {TODO NQPRX}

eval_is {apply {{} bar} foo} \
{wrong # args: should be "apply {{} bar}"} \
{too many args}
{too many args} {TODO NQPRX}

eval_is {apply {{n} {expr {$n*$n}}} {5}} 25 \
{squaring function}
{squaring function} {TODO NQPRX}

eval_is {
unset -nocomplain x func
Expand All @@ -40,6 +40,6 @@ eval_is {
}
apply [list {var {i 1}} $func] x
set x
} 5 {incr}
} 5 {incr} {TODO NQPRX}

# vim: filetype=tcl:
70 changes: 35 additions & 35 deletions t/cmd_array.t
Expand Up @@ -5,80 +5,80 @@ plan 50

eval_is {array}\
{wrong # args: should be "array option arrayName ?arg ...?"}\
{array, no args}
{array, no args} {TODO NQPRX}

eval_is {array exists}\
{wrong # args: should be "array option arrayName ?arg ...?"}\
{array, good subcommand, no array}
{array, good subcommand, no array} {TODO NQPRX}

eval_is {array bork foo}\
{bad option "bork": must be anymore, donesearch, exists, get, names, nextelement, set, size, startsearch, statistics, or unset}\
{array, bad subcommand, bad array}
{array, bad subcommand, bad array} {TODO NQPRX}

eval_is {
set b(c) 2
array exists b
} 1 {array exists yes}
} 1 {array exists yes} {TODO NQPRX}

eval_is {
set a 2
array exists a
} 0 {array exists no}
} 0 {array exists no} {TODO NQPRX}

eval_is {array exists q} 0 {array exists missing}
eval_is {array exists q} 0 {array exists missing} {TODO NQPRX}

eval_is {array exists a b}\
{wrong # args: should be "array exists arrayName"}\
{array exists too many args}
{array exists too many args} {TODO NQPRX}

eval_is {
proc test {} {
array set foo [list 1 2 3 4]
return [array exists foo]
}
test
} 1 {array exists lexical}
} 1 {array exists lexical} {TODO NQPRX}

eval_is {array size a b}\
{wrong # args: should be "array size arrayName"}\
{array size too many args}
{array size too many args} {TODO NQPRX}

eval_is {
catch {unset a}
set a(1) 1
array size a
} 1 {array size 1}
} 1 {array size 1} {TODO NQRPX}

eval_is {
catch {unset a}
set a(1) 1; set a(2) 2
array size a
} 2 {array size 2}
} 2 {array size 2} {TODO NQRPX}

eval_is {
catch {unset a}
set a 1
array size a
} 0 {}
} 0 {} {TODO NQRPX}

eval_is {
catch {unset a}
array set a [list a b]
set a(a)
} b {array set list}
} b {array set list} {TODO NQRPX}

eval_is {
catch {unset a}
array set a [list a b c d e f]
list $a(a) $a(c) $a(e)
} {b d f} {array set multi list}
} {b d f} {array set multi list} {TODO NQRPX}

eval_is {
catch {unset a}
set a(a) b
array set a [list c d e f]
list $a(a) $a(c) $a(e)
} {b d f} {array set preserve old values}
} {b d f} {array set preserve old values} {TODO NQRPX}

eval_is {
catch {unset a}
Expand All @@ -90,11 +90,11 @@ eval_is {
catch {unset a}
array set a {a b c d e f}
list $a(a) $a(c) $a(e)
} {b d f} {array set multi}
} {b d f} {array set multi} {TODO NQRPX}

eval_is {array set a a}\
{list must have an even number of elements}\
{array set uneven}
{array set uneven} {TODO NQRPX}

eval_is {array set a [list a b]} \
{}\
Expand All @@ -105,7 +105,7 @@ eval_is {
set a 44
array set a {1 2 3 4}
} {can't set "a(1)": variable isn't array}\
{array set not array}
{array set not array} {TODO NQRPX}

eval_is {
catch {unset a}
Expand All @@ -117,26 +117,26 @@ eval_is {
catch {unset a}
array set a [list a b]
array get a
} {a b} {array get}
} {a b} {array get} {TODO NQRPX}

eval_is {
catch {unset a}
array set a [list a {b c}]
array get a
} {a {b c}} {array get, insure list results}
} {a {b c}} {array get, insure list results} {TODO NQRPX}

eval_is {
catch {unset a}
array set a [list a b c d]
array get a a
} {a b} {array get with pattern}
} {a b} {array get with pattern} {TODO NQRPX}

eval_is {
catch {unset a}
array set a [list apple 1 orange 2 aardvark 3]
lsort [array get a a*]
} {1 3 aardvark apple}\
{array get, with pattern}
{array get, with pattern} {TODO NQRPX}

eval_is {
catch {unset a}
Expand All @@ -162,7 +162,7 @@ eval_is {

eval_is {array get a b c}\
{wrong # args: should be "array get arrayName ?pattern?"}\
{array get, too many args}
{array get, too many args} {TODO NQRPX}

eval_is {
catch {unset a}
Expand All @@ -174,20 +174,20 @@ eval_is {
catch {unset a}
array set a [list a b c d]
list [array unset a a] [array get a]
} {{} {c d}} {array unset, with pattern & return value}
} {{} {c d}} {array unset, with pattern & return value} {TODO NQRPX}

eval_is {
catch {unset a}
array set a [list apple 1 orange 2 aardvark 3]
list [array unset a a*] [array get a]
} {{} {orange 2}} {array unset with pattern}
} {{} {orange 2}} {array unset with pattern} {TODO NQRPX}

eval_is {
catch {unset a}
array set a [list apple 1 orange 2 aardvark 3]
list [array unset a zippy*] [lsort [array get a]]
} {{} {1 2 3 aardvark apple orange}}\
{array unset, with bad pattern}
{array unset, with bad pattern} {TODO NQRPX}

eval_is {
catch {unset a}
Expand All @@ -202,7 +202,7 @@ eval_is {
eval_is {
array unset monkey my monkey monkey
} {wrong # args: should be "array unset arrayName ?pattern?"}\
{array unset, too many args}
{array unset, too many args} {TODO NQRPX}

eval_is {
catch {unset a}
Expand All @@ -213,29 +213,29 @@ eval_is {
catch {unset a}
array set a [list {b c} a]
array names a
} {{b c}} {array names, insure list results}
} {{b c}} {array names, insure list results} {TODO NQRPX}

eval_is {array names a b c} \
{bad option "b": must be -exact, -glob, or -regexp} \
{array names, bad option}
{array names, bad option} {TODO NQRPX}

eval_is {array names a b c d}\
{wrong # args: should be "array names arrayName ?mode? ?pattern?"}\
{array names, too many args}
{array names, too many args} {TODO NQRPX}

eval_is {
catch {unset a}
set a(monkey) see
array names a
} {monkey} {array names, no pattern}
} {monkey} {array names, no pattern} {TODO NQRPX}

eval_is {
catch {unset a}
set a(monkey1) see
set a(monkey2) do
lsort [array names a monkey*]
} {monkey1 monkey2}\
{array names, default glob pattern}
{array names, default glob pattern} {TODO NQRPX}

eval_is {
catch {unset a}
Expand All @@ -249,7 +249,7 @@ eval_is {
set a(monkey1) see
set a(monkey2) do
lsort [array names a -glob monkey*]
} {monkey1 monkey2} {array names, explicit glob pattern}
} {monkey1 monkey2} {array names, explicit glob pattern} {TODO NQRPX}

eval_is {
catch {unset a}
Expand All @@ -263,7 +263,7 @@ eval_is {
set a(monkey1) see
set a(monkey2) do
array names a -exact monkey1
} {monkey1} {array names, explicit exact match}
} {monkey1} {array names, explicit exact match} {TODO NQRPX}

eval_is {
catch {unset a}
Expand All @@ -278,7 +278,7 @@ eval_is {
set a(monkey2) do
set a(ferret) don't
lsort [array names a -regexp ^mon.*]
} {monkey1 monkey2} {array names, explicit regexp match}
} {monkey1 monkey2} {array names, explicit regexp match} {TODO NQPRX}

eval_is {
catch {unset a}
Expand Down
4 changes: 2 additions & 2 deletions t/cmd_break.t
Expand Up @@ -24,12 +24,12 @@ eval_is {
proc test {} {break}
test
} {invoked "break" outside of a loop} \
{break outside of a loop}
{break outside of a loop} {TODO NQPRX}

eval_is {
proc test {} {break}
for {set i 0} {$i < 5} {incr i} {test}
} {invoked "break" outside of a loop} \
{break in a proc called in a loop}
{break in a proc called in a loop} {TODO NQPRX}

# vim: filetype=tcl:
8 changes: 4 additions & 4 deletions t/cmd_catch.t
Expand Up @@ -50,7 +50,7 @@ eval_is {
eval_is {
set a [catch blorg var]
list $a $var
} {1 {invalid command name "blorg"}} {error, invalid command}
} {1 {invalid command name "blorg"}} {error, invalid command} {TODO NQPRX}

eval_is {catch} \
{wrong # args: should be "catch script ?resultVarName? ?optionVarName?"} \
Expand All @@ -67,7 +67,7 @@ eval_is {
proc b {} {catch {a} msg; return $msg }
b
}
} ok {catch should respect the namespace it is invoked in}
} ok {catch should respect the namespace it is invoked in} {TODO NQPRX}

eval_is {
set a 3
Expand All @@ -76,7 +76,7 @@ eval_is {
set a [
}
set a
} 2 {execute code as soon as possible, don't wait until the end of the block}
} 2 {execute code as soon as possible, don't wait until the end of the block} {TODO NQPRX}

eval_is {
catch { return -errorcode 1 -errorinfo boo -code error -level 1 "eek" } msg opts
Expand All @@ -85,6 +85,6 @@ eval_is {
[dict get $opts -errorinfo] \
[dict get $opts -code] \
[dict get $opts -level]
} {eek 1 boo 1 1} {basic opts handling}
} {eek 1 boo 1 1} {basic opts handling} {TODO NQPRX}

# vim: filetype=tcl:

0 comments on commit 290c08d

Please sign in to comment.