Skip to content

Commit

Permalink
disable the hard parts of this test and TODO what needs it.
Browse files Browse the repository at this point in the history
  • Loading branch information
coke committed Apr 14, 2010
1 parent 783d48f commit 20fc1e0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
4 changes: 2 additions & 2 deletions build/Makefile.in
Expand Up @@ -100,15 +100,15 @@ TEST_FILES = \
t/tcl_backslash.t \
t/tcl_conversion.t \
t/tcl_command_subst.t \
t/tcl_glob.t
t/tcl_glob.t \
t/tcl_var_subst.t

# These t/*.t files are not yet runnable. Keep a list around so we know
# what to work on.
# 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
35 changes: 19 additions & 16 deletions t/tcl_var_subst.t
@@ -1,7 +1,7 @@
# Copyright (C) 2004-2007, The Parrot Foundation.

source lib/test_more.tcl
plan 22
plan 20

eval_is {
catch {unset a}
Expand Down Expand Up @@ -31,19 +31,19 @@ eval_is {
catch {unset a}
set a(b) whee
set b $a(b)
} whee {array, entire word}
} whee {array, entire word} {TODO NQPRX}

eval_is {
catch {unset a}
set a 2
set b $a(b)
} {can't read "a(b)": variable isn't array} {try to use scalar as array}
} {can't read "a(b)": variable isn't array} {try to use scalar as array} {TODO NQPRX}

eval_is {
catch {unset a}
set a(b) 2
set b $a
} {can't read "a": variable is array} {try to use array as scalar}
} {can't read "a": variable is array} {try to use array as scalar} {TODO NQPRX}

eval_is {
catch {unset x}
Expand All @@ -55,81 +55,83 @@ eval_is {
catch {unset x}
set x foo
set b $::x
} foo {explicit global}
} foo {explicit global} {TODO NQPRX}

eval_is {
namespace eval lib { variable version 0.1 }
set b $::lib::version
} 0.1 {absolute namespace var}
} 0.1 {absolute namespace var} {TODO NQPRX}

eval_is {
catch {unset x}
set ::x foo
set b $x
} foo {write to explicit global}
} foo {write to explicit global} {TODO NQPRX}

eval_is {
namespace eval lib { variable version }
set ::lib::version 0.1
set b $::lib::version
} 0.1 {write to absolute namespace var}
} 0.1 {write to absolute namespace var} {TODO NQPRX}

eval_is {
catch {unset array}
array set array {test ok}
set key test
set b $array($key)
} ok {variable index into array}
} ok {variable index into array} {TODO NQPRX}

eval_is {
catch {unset bar}
set b $foo($bar)
} {can't read "bar": no such variable} {invalid variable as key}
} {can't read "bar": no such variable} {invalid variable as key} {TODO NQPRX}

eval_is {
catch {unset foo}
array set foo {$ ok}
set b $foo($)
} ok {single $ as index}
} ok {single $ as index} {TODO NQPRX}

eval_is {
catch {unset foo}
array set foo {) ok}
set key )
set b $foo([set key])
} ok {use ) as a key}
} ok {use ) as a key} {TODO NQPRX}

eval_is {
catch {unset array}
catch {unset foo}
array set array {a 1 b 2 c 3}
set foo b
set b $array([set foo)
} {missing close-bracket} {missing ] in subcommand as key}
} {missing close-bracket} {missing ] in subcommand as key} {TODO NQPRX}

eval_is {
catch {unset array}
catch {unset foo}
array set array {a 1 b 2 c 3}
set foo b
set b $array([set foo]a)
} {can't read "array(ba)": no such element in array} {invalid key}
} {can't read "array(ba)": no such element in array} {invalid key} {TODO NQPRX}

eval_is {
catch {unset array}
array set array {a 1 b 2 c 3}
set ) b
set b $array([set )])
} 2 {use literal ) inside the array key}
} 2 {use literal ) inside the array key} {TODO NQPRX}

eval_is {
catch {unset x}
namespace eval foo { proc bar {} { return ok } }
set x foo
$x\::bar
} ok {namespace variable with escaped colon}
} ok {namespace variable with escaped colon} {TODO NQPRX}


if 0 {
# DRASTIC TODO NQPRX
namespace eval foo {
variable y 7
}
Expand All @@ -138,5 +140,6 @@ namespace eval test {
is [set foo::y] 7 {foo::y relative}
is [set x] 5 {x relative}
}
}

# vim: filetype=tcl:

0 comments on commit 20fc1e0

Please sign in to comment.