Permalink
Browse files

Updated various tests while fixing bugs

git-svn-id: svn://svn.tt2.org/tt/Template2/trunk@1135 d5a88997-0a34-4036-9ed2-92fb5d660d91
  • Loading branch information...
1 parent 5be1f36 commit fea9b8d10257a08061b0df3b1c919a99bfda75ef @abw committed Aug 6, 2008
Showing with 53 additions and 5 deletions.
  1. +12 −2 t/date.t
  2. +1 −1 t/html.t
  3. +19 −0 t/switch.t
  4. +20 −1 t/tags.t
  5. +1 −1 t/vars.t
View
@@ -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
@@ -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
View
@@ -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;
View
@@ -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
View
@@ -18,7 +18,7 @@
#========================================================================
use strict;
-use lib qw( ../lib );
+use lib qw( ./lib ../lib ./blib/lib ./blib/arch );
use Template::Test;
$^W = 1;
@@ -30,6 +30,8 @@ my $params = {
'c' => 'charlie',
'd' => 'delta',
'e' => 'echo',
+ tags => 'my tags',
+ flags => 'my flags',
};
my $tt = [
@@ -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
+
View
@@ -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;
@@ -620,3 +619,4 @@ e: 3
-%]
-- expect --
55
+

0 comments on commit fea9b8d

Please sign in to comment.