File: 32_compile_plugin.t

package info (click to toggle)
libhtml-template-compiled-perl 1.003-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 772 kB
  • sloc: perl: 4,759; makefile: 5
file content (28 lines) | stat: -rw-r--r-- 583 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use warnings;
use strict;
use lib 't';
use Test::More tests => 1;
use HTML::Template::Compiled;
use HTC_Utils qw($cache $tdir &cdir);
use HTC_Plugin;

{
    my $htc = HTML::Template::Compiled->new(
        scalarref => \<<'EOM',
<%homer beer=beercount %>
<%bart donut=donutcount %>
EOM
        plugin => [qw(HTC_Plugin1 HTC_Plugin2)],
        debug    => 0,
    );
    $htc->param(
        beercount => 3,
        donutcount => 7,
    );

    my $out = $htc->output;
    #print "out: $out\n";
    cmp_ok($out, '=~', qr{Homer wants 3 beers.*Bart wants 7 donuts}s, "two plugins");
}