Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Jemplate CPAN distribution.

Report information
The Basics
Id: 87566
Status: open
Priority: 0/
Queue: Jemplate

People
Owner: Nobody in particular
Requestors: ppisar [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: t/macro.t first test fails since 5.17.9
Following failure appears since perl 5.17.9 <http://matrix.cpantesters.org/?dist=Jemplate+0.27>. Also with stable perl 5.18.0: $ perl -Ilib t/macro.t 1..3 not ok 1 - # @@ -1,4 +1,4 @@ # -//line 1 "test_template" # +//line 2 "test_template" # # //MACRO # stash.set('simple', function () { # @@ -16,5 +16,5 @@ # # context.stash.clone(args); # try { # -//line 1 "test_template" # +//line 2 "test_template" # output += stash.get('param1') + stash.get('param2'); # # Failed test ' # @@ -1,4 +1,4 @@ # -//line 1 "test_template" # +//line 2 "test_template" # # //MACRO # stash.set('simple', function () { # @@ -16,5 +16,5 @@ # # context.stash.clone(args); # try { # -//line 1 "test_template" # +//line 2 "test_template" # output += stash.get('param1') + stash.get('param2'); # ' # at t/macro.t line 8. ok 2 ok 3 # Looks like you failed 1 test of 3.
I get the same error using Perl 5.16.3
From: jplesnik [...] redhat.com
The failure is caused by a change in Template::Parser (Teplate::Toolkit 2.25) In the function split_text, the line counter is increase, if newlines is in chomped whitespaces. There is a new line symbol at the end of macro definition, which increase the line counter.
From: jplesnik [...] redhat.com
On Fri Aug 30 10:02:19 2013, jplesnik wrote: Show quoted text
> The failure is caused by a change in Template::Parser > (Teplate::Toolkit 2.25) > > In the function split_text, the line counter is increase, if newlines > is in chomped whitespaces. > There is a new line symbol at the end of macro definition, which > increase the line counter.
Patch for test.
Subject: Fix_macro_t.patch
diff -up Jemplate-0.27/t/macro.t.orig Jemplate-0.27/t/macro.t --- Jemplate-0.27/t/macro.t.orig 2013-08-30 16:04:44.490408686 +0200 +++ Jemplate-0.27/t/macro.t 2013-08-30 17:03:06.613738405 +0200 @@ -16,8 +16,7 @@ __END__ [% MACRO simple(param1,param2) BLOCK; param1 _ param2; - END; -%] + END; %] --- js -trim //line 1 "test_template"
Subject: Re: [rt.cpan.org #87566] t/macro.t first test fails since 5.17.9
Date: Fri, 30 Aug 2013 09:34:00 -0700
To: bug-Jemplate [...] rt.cpan.org
From: Ingy dot Net <ingy [...] ingy.net>
Thanks! I'll take a look. On Fri, Aug 30, 2013 at 8:07 AM, Jitka Plesnikova via RT < bug-Jemplate@rt.cpan.org> wrote: Show quoted text
> Queue: Jemplate > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=87566 > > > On Fri Aug 30 10:02:19 2013, jplesnik wrote:
> > The failure is caused by a change in Template::Parser > > (Teplate::Toolkit 2.25) > > > > In the function split_text, the line counter is increase, if newlines > > is in chomped whitespaces. > > There is a new line symbol at the end of macro definition, which > > increase the line counter.
> > > Patch for test. >
From: jplesnik [...] redhat.com
I was wrong, the new lines at the begin of directive are count. Updated patch attached. On Fri Aug 30 12:34:11 2013, ingy@ingy.net wrote: Show quoted text
> Thanks! I'll take a look. > > > On Fri, Aug 30, 2013 at 8:07 AM, Jitka Plesnikova via RT < > bug-Jemplate@rt.cpan.org> wrote: >
> > Queue: Jemplate > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=87566 > > > > > On Fri Aug 30 10:02:19 2013, jplesnik wrote:
> > > The failure is caused by a change in Template::Parser > > > (Teplate::Toolkit 2.25) > > > > > > In the function split_text, the line counter is increase, if newlines > > > is in chomped whitespaces. > > > There is a new line symbol at the end of macro definition, which > > > increase the line counter.
> > > > > > Patch for test. > >
Subject: Fix_macro_t.patch
diff -up Jemplate-0.27/t/macro.t.orig Jemplate-0.27/t/macro.t --- Jemplate-0.27/t/macro.t.orig 2013-08-30 16:04:44.490408686 +0200 +++ Jemplate-0.27/t/macro.t 2013-09-02 08:04:43.968793401 +0200 @@ -13,11 +13,9 @@ __END__ === --- macro_definition -[% - MACRO simple(param1,param2) BLOCK; +[% MACRO simple(param1,param2) BLOCK; param1 _ param2; - END; -%] + END; %] --- js -trim //line 1 "test_template"
From: dsteinbrunner [...] pobox.com
On Mon Sep 02 02:48:22 2013, jplesnik wrote: Show quoted text
> I was wrong, the new lines at the begin of directive are count. > > Updated patch attached.
Pull request for this patch is here: https://github.com/ingydotnet/jemplate/pull/20