Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6f23e226fe
Fetching contributors…

Cannot retrieve contributors at this time

83 lines (70 sloc) 1.344 kb
use v6;
BEGIN { @*INC.unshift: './lib'; }
use Test;
use Template6;
plan 2;
my $t6 =;
$t6.add-path: 't/templates';
my $wanted = "<html>
<title>Nesting Test</title>
<td>VP Sales</td>
my @users =
:job<VP Sales>,
is $t6.process('simple-nest', :users(@users)), $wanted, 'Nested data with array of hashes';
class CompanyUser {
has $.name;
has $.job;
has $.birthday;
method age {
## A real application would use today, but our test is hard coded.
#my $now =;
my $now ='2012-07-17');
return (( - $.birthday) / 365).Int;
@users =<Bob>, :job<CEO>, :birthday('1985-07-13'))),<Lisa>, :job<Marketing>, :birthday('1994-05-11'))),<Melissa>, :job<VP Sales>, :birthday('1981-03-21')));
is $t6.process('simple-nest', :users(@users)), $wanted, 'Nested data with array of objects';
Jump to Line
Something went wrong with that request. Please try again.