Test case for the .length vmethod
Florian Ragwitz [Thu, 12 Sep 2013 21:00:14 +0000 (17:00 -0400)]
xt/tt.t

diff --git a/xt/tt.t b/xt/tt.t
index 573c141..cd026e7 100644 (file)
--- a/xt/tt.t
+++ b/xt/tt.t
@@ -46,4 +46,22 @@ is(
 
 is( do_tt('"0"', {}), '"0"' );
 
+{
+    my $tmpl = q[
+        [%- MACRO test(name, value) BLOCK;
+            IF !value.length;
+               "ok";
+            END;
+        END; -%]
+[%- test("foo", "") -%]
+];
+
+    my $with_html_string_tt = do_tt($tmpl, {});
+
+    $tt = Template->new(STASH => Template::Stash->new);
+    my $with_template = do_tt($tmpl, {});
+
+    is $with_html_string_tt, $with_template;
+}
+
 done_testing;