The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
#!perl -w
use strict;
use Test::More;
use Text::Xslate;

my %vpath = (
    'foo.tx' => 'foo.tx',
);

my $tx = Text::Xslate->new(
    function => { f => sub { 'foo.tx' } },
    path  => \%vpath,
    cache => 0,
);

is eval { $tx->render_string(': include f() ') }, 'foo.tx';
is eval { $tx->render_string(': my $x = f(); include "" ~ $x;') }, 'foo.tx';
is eval { $tx->render_string(': my $x = f(); include $x; ') }, 'foo.tx';

done_testing;