Created
August 21, 2014 02:16
-
-
Save acidlemon/66c041b0784c0b71776e to your computer and use it in GitHub Desktop.
This file contains 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 strict; | |
use warnings; | |
use utf8; | |
use Test::More; | |
use Text::Xslate; | |
use Data::Section::Simple; | |
my $tx = Text::Xslate->new( | |
syntax => 'TTerse', | |
path => [ Data::Section::Simple->new()->get_data_section() ], | |
); | |
my $result = $tx->render('include/index.tx', { name => 'Bob' }); | |
like $result, qr/Hello World, Bob!/; | |
done_testing; | |
__DATA__ | |
@@ include/index.tx | |
[% INCLUDE "include/parts.tx" %] | |
@@ include/parts.tx | |
Hello World, [% name %]! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment