HEX
Server: Apache
System: Linux server-634962.emtiyz.com 5.14.0-611.11.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Dec 3 09:47:37 EST 2025 x86_64
User: codo66ho (1003)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //home/.cpan/build/Template-Toolkit-3.102-0/t/meta.t
#============================================================= -*-perl-*-
#
# t/meta.t
#
# Test the meta() method in Template::Document.
#
# Written by Andy Wardley <abw@wardley.org>
#
# Copyright (C) 2022 Andy Wardley.  All Rights Reserved.
#
# This is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
#========================================================================

use strict;
use lib qw( ./lib ../lib );
use Template;
use Template::Test;

$^W = 1;

my $tt = Template->new || die Template->error;
my $template = $tt->template(\*DATA);
my $meta = $template->meta;

is( $meta->{ author }, 'Andy Wardley', 'fetched META author' );
is( $meta->{ animal }, 'Badger', 'fetched META animal' );
is( scalar(keys %$meta), 2, 'two items in meta' );


__END__
[% META
    author = 'Andy Wardley'
    animal = 'Badger'
%]
Hello world!