File: inline-comment.t

package info (click to toggle)
libtext-template-perl 1.61-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 288 kB
  • sloc: perl: 1,320; makefile: 2
file content (17 lines) | stat: -rwxr-xr-x 322 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!perl
#
# Test for comments within an inline code block

use strict;
use warnings;
use Test::More tests => 2;

use_ok 'Text::Template' or exit 1;

my $tmpl = Text::Template->new(
    TYPE => 'STRING',
    SOURCE => "Hello {\$name#comment}");

my $vars = { name => 'Bob' };

is $tmpl->fill_in(HASH => $vars), 'Hello Bob';