r46867 - in /trunk/libtext-micromason-perl: MANIFEST META.yml MicroMason.pm MicroMason/Docs/Changes.pod MicroMason/Docs/ReadMe.pod Text-MicroMason-2.03.tar debian/changelog t/33-filters.t

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sat Nov 7 02:33:32 UTC 2009


Author: jawnsy-guest
Date: Sat Nov  7 02:33:04 2009
New Revision: 46867

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=46867
Log:
IGNORE-VERSION: 2.04-1
NOTE: weird tarball from upstream
NOTE: only affects test failures when URI::Escape isn't installed
(thus doesn't matter for Debian)
* New upstream release

Added:
    trunk/libtext-micromason-perl/Text-MicroMason-2.03.tar
      - copied unchanged from r46866, branches/upstream/libtext-micromason-perl/current/Text-MicroMason-2.03.tar
    trunk/libtext-micromason-perl/t/33-filters.t
Modified:
    trunk/libtext-micromason-perl/MANIFEST
    trunk/libtext-micromason-perl/META.yml
    trunk/libtext-micromason-perl/MicroMason.pm
    trunk/libtext-micromason-perl/MicroMason/Docs/Changes.pod
    trunk/libtext-micromason-perl/MicroMason/Docs/ReadMe.pod
    trunk/libtext-micromason-perl/debian/changelog

Modified: trunk/libtext-micromason-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/MANIFEST?rev=46867&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/MANIFEST (original)
+++ trunk/libtext-micromason-perl/MANIFEST Sat Nov  7 02:33:04 2009
@@ -87,4 +87,5 @@
 t/90-cache-dir-conflict.t
 t/91-template_path.t
 t/92-template_path-cache.t
+Text-MicroMason-2.03.tar
 META.yml                                 Module meta-data (added by MakeMaker)

Modified: trunk/libtext-micromason-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/META.yml?rev=46867&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/META.yml (original)
+++ trunk/libtext-micromason-perl/META.yml Sat Nov  7 02:33:04 2009
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               Text-MicroMason
-version:            2.03
+version:            2.04
 abstract:           Simple and Extensible Templating
 author:
     - Alan Ferrency <ferrency at cpan.org>

Modified: trunk/libtext-micromason-perl/MicroMason.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/MicroMason.pm?rev=46867&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/MicroMason.pm (original)
+++ trunk/libtext-micromason-perl/MicroMason.pm Sat Nov  7 02:33:04 2009
@@ -1,5 +1,5 @@
 package Text::MicroMason;
-$VERSION = '2.03';
+$VERSION = '2.04';
 
 # The #line directive requires Perl 5.6 to work correctly the way we use
 # it in Base.

Modified: trunk/libtext-micromason-perl/MicroMason/Docs/Changes.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/MicroMason/Docs/Changes.pod?rev=46867&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/MicroMason/Docs/Changes.pod (original)
+++ trunk/libtext-micromason-perl/MicroMason/Docs/Changes.pod Sat Nov  7 02:33:04 2009
@@ -4,6 +4,17 @@
 
 
 =head1 VERSION 2 HISTORY
+
+=head2 Version 2.04
+
+=over 4
+
+=item 2009-11-06
+
+Fixed SKIP count in t/33_filters.t to prevent test failures when
+URI::Escape isn't installed.
+
+=back
 
 =head2 Version 2.03
 

Modified: trunk/libtext-micromason-perl/MicroMason/Docs/ReadMe.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/MicroMason/Docs/ReadMe.pod?rev=46867&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/MicroMason/Docs/ReadMe.pod (original)
+++ trunk/libtext-micromason-perl/MicroMason/Docs/ReadMe.pod Sat Nov  7 02:33:04 2009
@@ -50,7 +50,7 @@
 
 =head1 DISTRIBUTION STATUS
 
-This is version 2.03 of Text::MicroMason. 
+This is version 2.04 of Text::MicroMason. 
 
 This module has been available on CPAN for over six years. 
 

Modified: trunk/libtext-micromason-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/debian/changelog?rev=46867&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/debian/changelog (original)
+++ trunk/libtext-micromason-perl/debian/changelog Sat Nov  7 02:33:04 2009
@@ -1,3 +1,15 @@
+libtext-micromason-perl (2.04-1) UNRELEASED; urgency=low
+
+  IGNORE-VERSION: 2.04-1
+
+  NOTE: weird tarball from upstream
+  NOTE: only affects test failures when URI::Escape isn't installed
+  (thus doesn't matter for Debian)
+
+  * New upstream release
+
+ -- Jonathan Yu <jawnsy at cpan.org>  Fri, 06 Nov 2009 18:02:11 -0500
+
 libtext-micromason-perl (2.03-1) unstable; urgency=low
 
   [ Jonathan Yu ]

Added: trunk/libtext-micromason-perl/t/33-filters.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/t/33-filters.t?rev=46867&op=file
==============================================================================
--- trunk/libtext-micromason-perl/t/33-filters.t (added)
+++ trunk/libtext-micromason-perl/t/33-filters.t Sat Nov  7 02:33:04 2009
@@ -1,0 +1,138 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Test::More tests => 21;
+
+use_ok 'Text::MicroMason';
+
+ok my $m = Text::MicroMason->new( -Filters );
+
+my $res_nofilter = 'Hello <"world">!';
+
+######################################################################
+# Test an expression inside a template using logical or.
+
+is $m->execute( text => q(Var is <% $ARGS{foo} || 0 %>) ), "Var is 0";
+
+######################################################################
+# Test h encoding flag if we have HTML::Entities
+SKIP: {
+    skip "HTML::Entities is not installed", 4 
+        unless HTML::Entities->can('encode');
+
+    my $src_h = q(Hello <% '<"world">' |h %>!);
+    my $res_h = 'Hello &lt;&quot;world&quot;&gt;!';
+
+    is $m->execute(text => $src_h), $res_h, "Execute text with HTML::Entity filter";
+
+    # Test h as a default filter
+    {
+        local $m->{default_filters} = 'h';
+        my $src_h2 = q(Hello <% '<"world">' %>!);
+
+        is $m->execute( text => $src_h2), $res_h, "Execute text with HTML::Entity default filter";
+
+        # Explicitly disable the default filters
+        my $src_h3 = q(Hello <% '<"world">' | n %>!);
+        is $m->execute( text => $src_h3), $res_nofilter, "Execute text with HTML::Entity default turned off";
+    }
+
+    my $src_unh = qq(Hello <% '<"world">' |unh %>!);
+    my $res_unh = 'Hello &lt;&quot;world&quot;&gt;!';
+    is $m->execute( text => $src_unh), $res_unh, "Execute text with stacking h filter";
+} # SKIP
+
+######################################################################
+# Test default u encoding flag if we have URI::Escape
+SKIP: {
+    skip "URI::Escape is not installed", 8
+        unless URI::Escape->can('uri_escape');
+
+    my $res_u = 'Hello %3C%22world%22%3E!';
+
+    is $m->execute(text => qq(Hello <% '<"world">' |u %>!)), $res_u,
+        "Execute text with URI::Escape filter";
+
+    ok my $res = eval {$m->execute(text => qq(Hello <% '<"world">'|u %>!))},
+        "Execute text with URI::Escape filter and no space";
+    is $res, $res_u;
+
+    # Test |u encoding flag in a file
+    ok $res = eval {$m->execute(file => 'samples/test-filter.msn', msg => "foo")},
+        "Execute text from file with URI::Escape filter and no space";
+    is $res, "foo", "Filter execution error: $@";
+
+    # Test u as a default filter
+    {
+        local $m->{default_filters} = 'u';
+        my $src_u2 = qq(Hello <% '<"world">' %>!);
+        is $m->execute( text => $src_u2), $res_u, "Execute text with URI::Escape default filter";
+
+        # Explicitly disable the default filters
+        my $src_u3 = qq(Hello <% '<"world">' | n %>!);
+        my $res_u3 = 'Hello <"world">!';
+        is $m->execute( text => $src_u3), $res_nofilter, "Execute text with URI::Escape default turned off";
+    }
+
+    # Test stacking and canceling with n
+    my $res_hnu = 'Hello %3C%22world%22%3E!';  
+    my $src_hnu = qq(Hello <% '<"world">' |hnu %>!);
+    is $m->execute( text => $src_hnu), $res_hnu, "Execute text with stacking u filter";
+}
+
+
+
+######################################################################
+# Test custom filters
+
+sub f1 {
+    $_ = shift;
+    tr/elo/apy/;
+    $_;
+}
+
+sub f2 {
+    $_ = shift;
+    s/wyrpd/birthday/;
+    $_;
+}
+
+$m->filter_functions( f1 => \&f1 );
+$m->filter_functions( f2 => \&f2 );
+
+# Try one custom filter
+
+my $src_custom1 = qq(<% 'hello <"world">' | f1 %>);
+my $res_custom1 = qq(happy <"wyrpd">);
+is $m->execute( text => $src_custom1), $res_custom1;
+
+# Try two filters in order: they're order dependant, so this will fail
+# if they execute in the wrong order.
+
+my $src_custom2 = qq(<% 'hello <"world">' | f1 , f2 %>);
+my $res_custom2 = qq(happy <"birthday">);
+is $m->execute( text => $src_custom2), $res_custom2;
+
+
+# Try both filters as defaults
+{
+    local $m->{default_filters} = 'f1, f2';
+    my $src_custom3 = qq(<% 'hello <"world">' %>);
+    is $m->execute( text => $src_custom3), $res_custom2;
+
+    # Override default filters
+    my $src_custom4 = qq(<% 'hello <"world">' |n, f1 %>);
+    is $m->execute( text => $src_custom4), $res_custom1;
+}
+
+
+# Try one default filter and one additional filter
+{
+    local $m->{default_filters} = 'f1';
+    my $src_custom3 = qq(<% 'hello <"world">' %>);
+    is $m->execute( text => $src_custom3), $res_custom1;
+
+    my $src_custom4 = qq(<% 'hello <"world">' | f2 %>);
+    is $m->execute( text => $src_custom4), $res_custom2;
+}
+




More information about the Pkg-perl-cvs-commits mailing list