[Templates-cvs] cvs commit: Template2/t fileline.t filter.t foreach.t
cvs@template-toolkit.org
cvs@template-toolkit.org
cvs 06/05/30 15:53:49
Modified: t fileline.t filter.t foreach.t
Log:
Rebuild in preparation for 2.15b
Revision Changes Path
1.7 +6 -4 Template2/t/fileline.t
Index: fileline.t
===================================================================
RCS file: /template-toolkit/Template2/t/fileline.t,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- fileline.t 2006/05/29 14:09:26 1.6
+++ fileline.t 2006/05/30 15:53:48 1.7
@@ -12,12 +12,12 @@
# This is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
-# $Id: fileline.t,v 1.6 2006/05/29 14:09:26 abw Exp $
+# $Id: fileline.t,v 1.7 2006/05/30 15:53:48 abw Exp $
#
#========================================================================
use strict;
-use lib qw( ./lib ../lib );
+use lib qw( ./lib ../lib ./blib/lib ../blib/lib ./blib/arch ../blib/arch );
use Template::Test;
use Template::Parser;
use Template::Directive;
@@ -54,8 +54,10 @@
},
};
-my $tt2err = Template->new({ INCLUDE_PATH => $dir });
-my $tt2not = Template->new({ INCLUDE_PATH => $dir, FILE_INFO => 0 });
+my $tt2err = Template->new({ INCLUDE_PATH => $dir })
+ || die Template->error();
+my $tt2not = Template->new({ INCLUDE_PATH => $dir, FILE_INFO => 0 })
+ || die Template->error();
test_expect(\*DATA, [ err => $tt2err, not => $tt2not ], $vars);
2.23 +17 -5 Template2/t/filter.t
Index: filter.t
===================================================================
RCS file: /template-toolkit/Template2/t/filter.t,v
retrieving revision 2.22
retrieving revision 2.23
diff -u -r2.22 -r2.23
--- filter.t 2006/05/30 07:47:45 2.22
+++ filter.t 2006/05/30 15:53:48 2.23
@@ -12,18 +12,18 @@
# This is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
-# $Id: filter.t,v 2.22 2006/05/30 07:47:45 abw Exp $
+# $Id: filter.t,v 2.23 2006/05/30 15:53:48 abw Exp $
#
#========================================================================
use strict;
+use warnings;
use lib qw( ./lib ../lib );
use Template::Filters;
use Template qw( :status );
use Template::Parser;
use Template::Test;
use Template::Constants qw( :debug );
-$^W = 1;
my $DEBUG = grep(/^--?d(debug)?$/, @ARGV);
@@ -61,7 +61,7 @@
# tie STDERR to a variable
my $stderr = '';
-tie(*STDERR, "Tie::File2Str", \$stderr);
+#tie(*STDERR, "Tie::File2Str", \$stderr);
my $dir = -d 't' ? 't/test/tmp' : 'test/tmp';
my $file = 'xyz';
@@ -76,7 +76,9 @@
outfile => $file,
stderr => sub { $stderr },
despace => bless(\&despace, 'anything'),
+ widetext => "wide:\x{65e5}\x{672c}\x{8a9e}",
};
+
my $filters = {
'nonfilt' => 'nonsense',
'microjive' => \µjive,
@@ -100,10 +102,15 @@
unlink "$dir/$file" if -f "$dir/$file";
-my $tt1 = Template->new($config1);
-my $tt2 = Template->new($config2);
+my $tt1 = Template->new($config1)
+ || die Template->error();
+my $tt2 = Template->new($config2)
+ || die Template->error();
+
$tt2->context->define_filter('another', \&another, 1);
+tie(*STDERR, "Tie::File2Str", \$stderr);
+
test_expect(\*DATA, [ default => $tt1, evalperl => $tt2 ], $params);
ok( -f "$dir/$file", "$dir/$file exists" );
@@ -901,6 +908,11 @@
[% "my<file & your>file.html" | uri | html %]
-- expect --
my%3Cfile%20%26%20your%3Efile.html
+
+-- test --
+[% widetext | uri %]
+-- expect --
+wide%3A%E6%97%A5%E6%9C%AC%E8%AA%9E
-- test --
[% 'foobar' | ucfirst %]
2.10 +11 -11 Template2/t/foreach.t
Index: foreach.t
===================================================================
RCS file: /template-toolkit/Template2/t/foreach.t,v
retrieving revision 2.9
retrieving revision 2.10
diff -u -r2.9 -r2.10
--- foreach.t 2003/04/29 12:49:31 2.9
+++ foreach.t 2006/05/30 15:53:48 2.10
@@ -12,7 +12,7 @@
# This is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
-# $Id: foreach.t,v 2.9 2003/04/29 12:49:31 abw Exp $
+# $Id: foreach.t,v 2.10 2006/05/30 15:53:48 abw Exp $
#
#========================================================================
@@ -58,20 +58,20 @@
'months' => sub { return \@months },
'format' => \&format,
'people' => [
- { id => 'abw', code => 'abw', name => 'Andy Wardley' },
- { id => 'aaz', code => 'zaz', name => 'Azbaz Azbaz Zazbazzer' },
- { id => 'bcd', code => 'dec', name => 'Binary Coded Decimal' },
- { id => 'efg', code => 'zzz', name => 'Extra Fine Grass' },
+ { id => 'abw', code => 'abw', name => 'Andy Wardley' },
+ { id => 'aaz', code => 'zaz', name => 'Azbaz Azbaz Zazbazzer' },
+ { id => 'bcd', code => 'dec', name => 'Binary Coded Decimal' },
+ { id => 'efg', code => 'zzz', name => 'Extra Fine Grass' },
],
'sections' => {
- one => 'Section One',
- two => 'Section Two',
- three => 'Section Three',
- four => 'Section Four',
+ one => 'Section One',
+ two => 'Section Two',
+ three => 'Section Three',
+ four => 'Section Four',
},
nested => [
- [ qw( a b c ) ],
- [ qw( x y z ) ],
+ [ qw( a b c ) ],
+ [ qw( x y z ) ],
],
};