Permalink
Browse files

Ensure clean callbacks with newest Tcl.pm

  • Loading branch information...
1 parent a21d313 commit cbf36960fcb731d1f77448f1eee9fb4cec299261 @gisle committed Nov 28, 2009
Showing with 29 additions and 1 deletion.
  1. +1 −0 MANIFEST
  2. +1 −1 Makefile.PL
  3. +27 −0 t/tcl-callback.t
View
1 MANIFEST
@@ -8,6 +8,7 @@ t/mega.t
t/mega-config.t
t/nul-char.t
t/tcl.t
+t/tcl-callback.t
t/tk.t
t/utf8.t
tkx-ed
View
2 Makefile.PL
@@ -8,7 +8,7 @@ WriteMakefile(
VERSION_FROM => 'Tkx.pm',
ABSTRACT_FROM => 'Tkx.pm',
PREREQ_PM => {
- Tcl => 0.81,
+ Tcl => 0.98,
},
AUTHOR => 'Gisle Aas <gisle@activestate.com>',
EXE_FILES => [qw(tkx-ed tkx-prove)],
View
27 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.