[Jifty-commit] r3192 - Template-Declare/t

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Wed May 2 19:48:56 EDT 2007


Author: ruz
Date: Wed May  2 19:48:55 2007
New Revision: 3192

Added:
   Template-Declare/t/utf8.t

Log:
* add simple tests for utf8 happines

Added: Template-Declare/t/utf8.t
==============================================================================
--- (empty file)
+++ Template-Declare/t/utf8.t	Wed May  2 19:48:55 2007
@@ -0,0 +1,63 @@
+
+use warnings;
+use strict;
+use utf8;# 'UTF-8';
+
+
+package Wifty::UI;
+use base qw/Template::Declare/;
+use Template::Declare::Tags;
+
+# 'test' in Russian
+my $str = "\x{442}\x{435}\x{441}\x{442}";
+
+template simple_outs => sub { outs("$str") };
+
+template double_outs => sub { outs("$str"); outs("$str") };
+
+template tag_outs => sub { p { outs("$str") } };
+template double_tag_outs => sub { p { outs("$str") } p { outs("$str") } };
+
+Template::Declare->init(roots => ['Wifty::UI']);
+
+1;
+
+use Test::More tests => 8;
+require "t/utils.pl";
+
+{
+    my $simple = (show('simple_outs'));
+    ok($simple =~ m{^\s*$str\s*$}s);
+    # diag ($simple);
+    ok_lint($simple);
+}
+Template::Declare->buffer->clear;
+
+{
+    my $simple = (show('double_outs'));
+    ok($simple =~ m{^\s*$str\s*$str\s*$}s);
+    # diag ($simple);
+    ok_lint($simple);
+}
+Template::Declare->buffer->clear;
+
+{
+    my $simple = (show('tag_outs'));
+    ok($simple =~ m{^\s*<p>\s*$str\s*</p>\s*$}s);
+    # diag ($simple);
+    TODO: { local $TODO = "lint doesn't handle unicode sometimes";
+        ok_lint($simple);
+    }
+}
+Template::Declare->buffer->clear;
+
+{
+    my $simple = (show('double_tag_outs'));
+    ok($simple =~ m{^\s*<p>\s*$str\s*</p>\s*<p>\s*$str\s*</p>\s*$}s);
+    # diag ($simple);
+    TODO: { local $TODO = "lint doesn't handle unicode";
+        ok_lint($simple);
+    }
+}
+Template::Declare->buffer->clear;
+


More information about the Jifty-commit mailing list