Skip to content

Commit

Permalink
Ensure clean callbacks with newest Tcl.pm
Browse files Browse the repository at this point in the history
  • Loading branch information
gisle committed Nov 28, 2009
1 parent a21d313 commit cbf3696
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions MANIFEST
Expand Up @@ -8,6 +8,7 @@ t/mega.t
t/mega-config.t t/mega-config.t
t/nul-char.t t/nul-char.t
t/tcl.t t/tcl.t
t/tcl-callback.t
t/tk.t t/tk.t
t/utf8.t t/utf8.t
tkx-ed tkx-ed
Expand Down
2 changes: 1 addition & 1 deletion Makefile.PL
Expand Up @@ -8,7 +8,7 @@ WriteMakefile(
VERSION_FROM => 'Tkx.pm', VERSION_FROM => 'Tkx.pm',
ABSTRACT_FROM => 'Tkx.pm', ABSTRACT_FROM => 'Tkx.pm',
PREREQ_PM => { PREREQ_PM => {
Tcl => 0.81, Tcl => 0.98,
}, },
AUTHOR => 'Gisle Aas <gisle@activestate.com>', AUTHOR => 'Gisle Aas <gisle@activestate.com>',
EXE_FILES => [qw(tkx-ed tkx-prove)], EXE_FILES => [qw(tkx-ed tkx-prove)],
Expand Down
27 changes: 27 additions & 0 deletions t/tcl-callback.t
@@ -0,0 +1,27 @@
#!perl -w

use strict;
use Test;

plan tests => 7;

use Tkx qw(set after);

set("foo", sub {
ok @_, 2;
ok "@_", "a b c";
});
ok set("foo"), qr/^::perl::CODE\(0x/;
Tkx::eval('[set foo] a {b c}');

set("foo", [sub {
ok @_, 4;
ok "@_", "a b c d e f";
}, "d", "e f"]);
Tkx::eval('[set foo] a {b c}');

set("foo", [sub {
ok @_, 6;
ok "@_", "2 3 a b c d";
}, Tkx::Ev('[expr 1+1]', '[expr 1+2]'), "c", "d"]);
Tkx::eval('eval [set foo] a b');

0 comments on commit cbf3696

Please sign in to comment.