[Jifty-commit] r3912 - in Template-Declare: t

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Thu Aug 16 23:00:16 EDT 2007


Author: agentz
Date: Thu Aug 16 23:00:15 2007
New Revision: 3912

Modified:
   Template-Declare/lib/Template/Declare.pm
   Template-Declare/t/arg-passing.t

Log:
TD - more tests for t/arg-passing.t and POD tweaks in T::D

Modified: Template-Declare/lib/Template/Declare.pm
==============================================================================
--- Template-Declare/lib/Template/Declare.pm	(original)
+++ Template-Declare/lib/Template/Declare.pm	Thu Aug 16 23:00:15 2007
@@ -299,7 +299,7 @@
 
 =item *
 
-Another place that requires trailing semicolon is the statements before a Perl looping or branching statement, for example:
+Another place that requires trailing semicolon is the statements before a Perl looping statement, an if statement, or a C<show> call. For example:
 
     p { "My links:" };
     for (@links) {

Modified: Template-Declare/t/arg-passing.t
==============================================================================
--- Template-Declare/t/arg-passing.t	(original)
+++ Template-Declare/t/arg-passing.t	Thu Aug 16 23:00:15 2007
@@ -18,10 +18,20 @@
    div { "outer: $arg" }
 };
 
+template add  => sub {
+    my ($self, $a, $b) = @_;
+    outs "$a + $b";
+};
+
+template host => sub {
+    my $self = shift;
+    show('add', 3, 7);
+};
+
 package main;
 use strict;
 use warnings;
-use Test::More tests => 3;
+use Test::More tests => 5;
 use Template::Declare;
 Template::Declare->init(roots => ['MyApp::Templates']);
 
@@ -32,3 +42,9 @@
 like($out, qr/outer: xyzzy/);
 like($out, qr/inner: XYZZY/);
 
+$out = Template::Declare->show('add', '32', '56');
+is($out, '32 + 56');
+
+$out = Template::Declare->show('host');
+is($out, '3 + 7');
+


More information about the Jifty-commit mailing list