diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-09-28 17:33:47 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-09-28 17:33:47 -0500 |
commit | 49db5f5704835b7336c67ecf4ba14a5a5f3a8527 (patch) | |
tree | ff79270672e31a46a0cd36d48b8c4e0f7a9a85d6 /t/safestring.t | |
parent | c964148db9790676e892265327f567939619c349 (diff) | |
download | text-handlebars-49db5f5704835b7336c67ecf4ba14a5a5f3a8527.tar.gz text-handlebars-49db5f5704835b7336c67ecf4ba14a5a5f3a8527.zip |
remove test numbers
Diffstat (limited to 't/safestring.t')
-rw-r--r-- | t/safestring.t | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/t/safestring.t b/t/safestring.t new file mode 100644 index 0000000..27d9ac1 --- /dev/null +++ b/t/safestring.t @@ -0,0 +1,35 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; + +use Text::Handlebars; +use Text::Xslate 'mark_raw'; + +my $tx = Text::Handlebars->new; + +is( + $tx->render_string( + '<h1>{{title}}</h1><p>{{{body}}}</p>', + { title => 'My New Post', body => 'This is my first post!' }, + ), + '<h1>My New Post</h1><p>This is my first post!</p>', +); + +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>' }, + ), + '<h1>All About <p> Tags</h1><p><i>This is a post about <p> tags</i></p>', +); + +is( + $tx->render_string( + '<h1>{{title}}</h1><p>{{{body}}}</p>', + { 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>', +); + +done_testing; |