Created
December 29, 2010 04:09
-
-
Save tomyhero/758156 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use warnings; | |
use strict; | |
use Test::More; | |
use Data::Section::Simple; | |
use Text::Xslate; | |
my $reader = Data::Section::Simple->new(__PACKAGE__); | |
my $templates = $reader->get_data_section; | |
my $tx = Text::Xslate->new( | |
syntax => 'TTerse', | |
path => [ $templates ] | |
); | |
is($tx->render('koreyaritai'), $tx->render('imakousiteru')); | |
__DATA__ | |
@@ koreyaritai | |
<html> | |
<head></head> | |
<body> | |
hogehoge | |
[% WRAPPER 'footer' INTO footer_content %] | |
<script>alert('hoge');</script> | |
[% END %] | |
@@ footer | |
[% footer_content %] | |
</body> | |
</html> | |
@@ imakousiteru | |
<html> | |
<head></head> | |
<body> | |
hogehoge | |
[% MACRO footer_content_block BLOCK %] | |
<script>alert('hoge');</script> | |
[% END %] | |
[% INCLUDE 'footer' WITH | |
footer_content = footer_content_block() | |
%] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment