From: Florian Ragwitz Date: Thu, 12 Sep 2013 21:00:14 +0000 (-0400) Subject: Test case for the .length vmethod X-Git-Tag: v1.000005~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c3ffad02009566171a1c9ca13bef64c51d853d29;p=scpubgit%2FHTML-String.git Test case for the .length vmethod --- diff --git a/xt/tt.t b/xt/tt.t index 573c141..cd026e7 100644 --- 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;