diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-09-27 13:55:35 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-09-27 13:55:35 -0500 |
commit | c4ec8e689764348f2e6d56e46b192209187033a2 (patch) | |
tree | d09077aafb4dbe8d4e810423f0ed642fd4d89c29 /t | |
parent | a96361ab84452a83bdca37e37c5438f41c5e2be1 (diff) | |
download | text-handlebars-c4ec8e689764348f2e6d56e46b192209187033a2.tar.gz text-handlebars-c4ec8e689764348f2e6d56e46b192209187033a2.zip |
basic implementation of raw strings
Diffstat (limited to 't')
-rw-r--r-- | t/003-safestring.t | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/t/003-safestring.t b/t/003-safestring.t index 77aa7de..8e095ea 100644 --- a/t/003-safestring.t +++ b/t/003-safestring.t @@ -1,7 +1,7 @@ use strict; use warnings; use Test::More; -use Text::Xslate; +use Text::Xslate 'mark_raw'; my $tx = Text::Xslate->new(syntax => 'Handlebars'); @@ -16,18 +16,15 @@ is( is( $tx->render_string( '<h1>{{title}}</h1><p>{{{body}}}</p>', - { title => 'All about <p> Tags', body => '<i>This is a post about <p> tags</i>' }, + { title => 'All About <p> Tags', body => '<i>This is a post about <p> tags</i>' }, ), '<h1>All About <p> Tags</h1><p><i>This is a post about <p> tags</i></p>', ); -# XXX I'm not sure what the safestring constructor should be called -# it's effectively Handlebars::SafeString->new($str) in JS -# maybe we can just use Text::Xslate's mark_raw directly is( $tx->render_string( '<h1>{{title}}</h1><p>{{{body}}}</p>', - { title => Handlebars::SafeString->new('All about <p> Tags'), body => '<i>This is a post about <p> tags</i>' }, + { title => mark_raw('All About <p> Tags'), body => '<i>This is a post about <p> tags</i>' }, ), '<h1>All About <p> Tags</h1><p><i>This is a post about <p> tags</i></p>', ); |