Skip to content

Commit

Permalink
Updated various tests while fixing bugs
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.tt2.org/tt/Template2/trunk@1135 d5a88997-0a34-4036-9ed2-92fb5d660d91
  • Loading branch information
abw committed Aug 6, 2008
1 parent 5be1f36 commit fea9b8d
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 5 deletions.
14 changes: 12 additions & 2 deletions t/date.t
Expand Up @@ -197,8 +197,13 @@ In French, today's day is: [% time_locale(time, '%A', 'fr_FR') +%]
-- test --
[% USE date %]
[% date.format('4:20:00 6-13-2000', '%H') %]
[% date.format('4:20:00 13-6-2000', '%H') %]
-- expect --
04
-- test --
[% USE date %]
[% date.format('2000-6-13 4:20:00', '%H') %]
-- expect --
04
Expand Down Expand Up @@ -250,4 +255,9 @@ not testing
-- expect --
12:59
-- test --
[% USE date;
date.format('2001/09/30 12:59:00', '%H:%M')
-%]
-- expect --
12:59
2 changes: 1 addition & 1 deletion t/html.t
Expand Up @@ -16,11 +16,11 @@
#========================================================================

use strict;
use warnings;
use lib qw( ./lib ../lib );
use Template;
use Template::Test;
use Template::Plugin::HTML;
$^W = 1;

my $DEBUG = grep(/-d/, @ARGV);
$Template::Test::DEBUG = $DEBUG;
Expand Down
19 changes: 19 additions & 0 deletions t/switch.t
Expand Up @@ -275,3 +275,22 @@ before
matched
after
#-----------------------------------------------------------------------
# regex metacharacter quoting
# http://rt.cpan.org/Ticket/Display.html?id=24183
#-----------------------------------------------------------------------
-- test --
[% foo = 'a(b)'
bar = 'a(b)';
SWITCH foo;
CASE bar;
'ok';
CASE;
'not ok';
END
%]
-- expect --
ok
21 changes: 20 additions & 1 deletion t/tags.t
Expand Up @@ -18,7 +18,7 @@
#========================================================================

use strict;
use lib qw( ../lib );
use lib qw( ./lib ../lib ./blib/lib ./blib/arch );
use Template::Test;
$^W = 1;

Expand All @@ -30,6 +30,8 @@ my $params = {
'c' => 'charlie',
'd' => 'delta',
'e' => 'echo',
tags => 'my tags',
flags => 'my flags',
};

my $tt = [
Expand Down Expand Up @@ -212,3 +214,20 @@ a: 10
a is [* a *]
-- expect --
a is 10
-- test --
[% tags; flags %]
[* a = 10 -*]
a is [* a *]
-- expect --
my tagsmy flags
[* a = 10 -*]
a is [* a *]
-- test --
flags: [% flags | html %]
tags: [% tags | html %]
-- expect --
flags: my flags
tags: my tags
2 changes: 1 addition & 1 deletion t/vars.t
Expand Up @@ -23,7 +23,6 @@ use Template::Test;
use Template::Stash;
use Template::Constants qw( :status );
use Template::Directive;

use Template::Parser;
$Template::Test::DEBUG = 0;
$Template::Parser::DEBUG = 0;
Expand Down Expand Up @@ -620,3 +619,4 @@ e: 3
-%]
-- expect --
55

0 comments on commit fea9b8d

Please sign in to comment.