[Templates-cvs] cvs commit: TT3/t/parser term.t
cvs@template-toolkit.org
cvs@template-toolkit.org
Fri, 03 Dec 2004 10:05:06 +0000
cvs 04/12/03 10:05:06
Modified: t/parser term.t
Log:
* added tests for empty strings
Revision Changes Path
1.14 +28 -12 TT3/t/parser/term.t
Index: term.t
===================================================================
RCS file: /template-toolkit/TT3/t/parser/term.t,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- term.t 2004/12/02 16:46:47 1.13
+++ term.t 2004/12/03 10:05:06 1.14
@@ -10,7 +10,7 @@
# This is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
-# $Id: term.t,v 1.13 2004/12/02 16:46:47 abw Exp $
+# $Id: term.t,v 1.14 2004/12/03 10:05:06 abw Exp $
#
#========================================================================
@@ -20,7 +20,7 @@
use lib qw( ./lib ../lib ../../lib );
use Template::Parser;
use Template::Generator::Debug;
-use Template::Test tests => 68, import => ':all';
+use Template::Test tests => 71, import => ':all';
our $DEBUG =
$Template::Parser::DEBUG =
@@ -140,13 +140,10 @@
__DATA__
-# term : number | squote | dquote | qwlist | list | hash | paren | var
-# number: sign ( hexnum | float exponent )
-
-#========================================================================
+#------------------------------------------------------------------------
# numbers
-#=======================================================================
+#------------------------------------------------------------------------
-- test hex numbers --
0x0
@@ -252,20 +249,39 @@
-#========================================================================
-# strings
-#=======================================================================
+#------------------------------------------------------------------------
+# single quoted strings
+#------------------------------------------------------------------------
+
+-- test empty single quoted string --
+''
+-- expect --
+<squote:>
-- test single quoted string --
'hello'
'"hello" world'
-'foo \'bar\' baz\nxyz'
-'foo 10\3 bar'
-- expect --
<squote:hello>
<squote:"hello" world>
+
+-- test single quoted string with backslashes --
+'foo \'bar\' baz\nxyz'
+'foo 10\3 bar'
+-- expect --
<squote:foo \'bar\' baz\nxyz>
<squote:foo 10\3 bar>
+
+
+#------------------------------------------------------------------------
+# double quoted strings
+#------------------------------------------------------------------------
+
+-- test empty double quoted string --
+""
+-- expect --
+<dquote:
+>
-- test double quoted string --
"hello"