3 # Copyright (C) 2006-2007, The Perl Foundation.
8 use lib qw(tcl/lib ./lib ../lib ../../lib ../../../lib);
10 use Parrot::Test tests => 10;
13 language_output_is( "tcl", <<'TCL', <<'OUT', 'upvar $command' );
14 proc test {} {uplevel {set a 42}}
21 language_output_is( "tcl", <<'TCL', <<'OUT', "uplevel - bad args" );
24 wrong # args: should be "uplevel ?level? command ?arg ...?"
27 language_output_is( 'tcl', <<'TCL', <<'OUT', 'uplevel - bad args' );
30 wrong # args: should be "uplevel ?level? command ?arg ...?"
33 language_output_is( "tcl", <<'TCL', <<'OUT', "uplevel - bad level" );
39 language_output_is( "tcl", <<'TCL', <<'OUT', "uplevel 0" );
40 proc test {} {uplevel 0 {set a 42}; puts $a}
46 language_output_is( "tcl", <<'TCL', <<'OUT', "uplevel #0" );
47 proc a {} {uplevel #0 {set a 42}}
55 language_output_is( "tcl", <<'TCL', <<'OUT', "uplevel - from one lexical to another" );
56 proc add2to_a {} {uplevel {set a [expr {$a+2}]}}
57 proc test {} { set a 1; add2to_a; puts $a }
63 language_output_is( 'tcl',
64 <<'TCL', <<'OUT', 'uplevel - from one lexical in an uplevel to another' );
87 language_output_is( 'tcl', <<'TCL', <<'OUT', 'uplevel - reset environent on execption' );
88 proc test {} {catch {uplevel #0 {error "foo"}}}
96 language_output_is( 'tcl', <<'TCL', <<'OUT', 'uplevel - info level interaction' );
97 proc test {} {uplevel {info level}}
105 # cperl-indent-level: 4
108 # vim: expandtab shiftwidth=4: