Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 104 lines (86 sloc) 1.676 kb
d6ead2c Initial commit from r31638 of https://svn.perl.org/parrot/trunk/language...
wcoleda authored
1 #!perl
2
06994a0 Update the files in the repo to add the Parrot Foundation as copyright h...
arbelo authored
3 # Copyright (C) 2004-2007, The Parrot Foundation.
d6ead2c Initial commit from r31638 of https://svn.perl.org/parrot/trunk/language...
wcoleda authored
4
5 use strict;
6 use warnings;
c34bff7 Tests only need to run from top level build dir.
wcoleda authored
7 use lib qw(lib);
d6ead2c Initial commit from r31638 of https://svn.perl.org/parrot/trunk/language...
wcoleda authored
8
5920afd Roll out own _output_is test functions, so we don't have to rely on parr...
wcoleda authored
9 use Parrot::Test::Tcl;
10 use Test::More tests=> 9;
d6ead2c Initial commit from r31638 of https://svn.perl.org/parrot/trunk/language...
wcoleda authored
11
5920afd Roll out own _output_is test functions, so we don't have to rely on parr...
wcoleda authored
12 tcl_output_is( <<'TCL', <<OUT, "rename" );
d6ead2c Initial commit from r31638 of https://svn.perl.org/parrot/trunk/language...
wcoleda authored
13 set a 2
14 rename puts fnord
15 fnord $a
16 TCL
17 2
18 OUT
19
5920afd Roll out own _output_is test functions, so we don't have to rely on parr...
wcoleda authored
20 tcl_output_is( <<'TCL', <<OUT, "remove" );
d6ead2c Initial commit from r31638 of https://svn.perl.org/parrot/trunk/language...
wcoleda authored
21 rename puts ""
22 puts "Whee"
23 TCL
24 invalid command name "puts"
25 OUT
26
5920afd Roll out own _output_is test functions, so we don't have to rely on parr...
wcoleda authored
27 tcl_output_is( <<'TCL', <<'OUT', "rename non-existant command" );
d6ead2c Initial commit from r31638 of https://svn.perl.org/parrot/trunk/language...
wcoleda authored
28 rename foo blah
29 TCL
30 can't rename "foo": command doesn't exist
31 OUT
32
5920afd Roll out own _output_is test functions, so we don't have to rely on parr...
wcoleda authored
33 tcl_output_is( <<'TCL', <<'OUT', "delete non-existant command" );
d6ead2c Initial commit from r31638 of https://svn.perl.org/parrot/trunk/language...
wcoleda authored
34 rename foo ""
35 TCL
36 can't delete "foo": command doesn't exist
37 OUT
38
5920afd Roll out own _output_is test functions, so we don't have to rely on parr...
wcoleda authored
39 tcl_output_is( <<'TCL', <<'OUT', 'new command already exists' );
d6ead2c Initial commit from r31638 of https://svn.perl.org/parrot/trunk/language...
wcoleda authored
40 rename if incr
41 TCL
42 can't rename to "incr": command already exists
43 OUT
44
5920afd Roll out own _output_is test functions, so we don't have to rely on parr...
wcoleda authored
45 tcl_output_is( <<'TCL', <<'OUT', "test fallback to interpreted versions of normally inlined commands." );
d6ead2c Initial commit from r31638 of https://svn.perl.org/parrot/trunk/language...
wcoleda authored
46 set a 1
47 incr a
48 rename if {}
49 incr a
50 puts $a
51 TCL
52 3
53 OUT
54
acd181e use init.tcl's [unknown] instead of trying to roll our own.
wcoleda authored
55 tcl_output_is( <<'TCL', <<'OUT', "delete inlined sub", todo => "failing after switch to tcl's [unknown]");
d6ead2c Initial commit from r31638 of https://svn.perl.org/parrot/trunk/language...
wcoleda authored
56 set a 1
57 incr a
58 puts $a
59 rename incr {}
60 incr a
61 TCL
62 2
63 invalid command name "incr"
64 OUT
65
5920afd Roll out own _output_is test functions, so we don't have to rely on parr...
wcoleda authored
66 tcl_output_is( <<'TCL', <<'OUT', "rename inlined sub" );
d6ead2c Initial commit from r31638 of https://svn.perl.org/parrot/trunk/language...
wcoleda authored
67 set a 1
68 rename incr foo
69 foo a
70 puts $a
71 TCL
72 2
73 OUT
74
5920afd Roll out own _output_is test functions, so we don't have to rely on parr...
wcoleda authored
75 tcl_output_is( <<'TCL', <<'OUT', "rename in a namespace" );
d6ead2c Initial commit from r31638 of https://svn.perl.org/parrot/trunk/language...
wcoleda authored
76 proc puts2 {args} {puts {*}$args}
77
78 namespace eval joe {
79 proc puts2 {args} {puts "HELLO WORLD"}
80 }
81
82 namespace eval joe {
83 puts2 "HI THERE"
84 rename puts2 {}
85 }
86
87 puts2 "HI THERE"
88
89 namespace eval joe {
90 puts "HI THERE"
91 }
92 TCL
93 HELLO WORLD
94 HI THERE
95 HI THERE
96 OUT
97
98 # Local Variables:
99 # mode: cperl
100 # cperl-indent-level: 4
101 # fill-column: 100
102 # End:
103 # vim: expandtab shiftwidth=4:
Something went wrong with that request. Please try again.