File: 02_obj.t

package info (click to toggle)
libtemplate-provider-encoding-perl 0.10-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 96 kB
  • sloc: perl: 52; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 538 bytes parent folder | download | duplicates (4)
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 strict;
use Test::More;

eval { require DateTime; 1 };
if ($@) {
    plan skip_all => 'require DateTime';
}

use Template;
use Template::Stash::ForceUTF8;

if ($Template::Config::STASH ne 'Template::Stash::XS') {
    plan skip_all => 'require Template::Stash::XS';
}

plan tests => 1;

my $tt = Template->new({
    STASH => Template::Stash::ForceUTF8->new,
});

my $dt = DateTime->new(year => 2005, month => 9, day => 12);
$tt->process(\<<EOF, { dt => $dt }, \my $out) or die $tt->error;
[% dt.ymd %]
EOF

like $out, qr/2005-09-12/;