From d0bb27bf230fb06d4ad263574df811bb67d5d4a2 Mon Sep 17 00:00:00 2001 From: Chris Hall Date: Fri, 9 Dec 2011 11:04:19 +1300 Subject: [PATCH 1/2] Bug 5327: Patch removes unneeded self=shift from TTParser::unshift_token Removed unneeded self=shift from unshift_token (as peek and next do not take a self, makes interface more consistent) http://bugs.koha-community.org/show_bug.cgi?id=5327 Signed-off-by: Katrin Fischer Signed-off-by: Jared Camins-Esakov --- C4/TTParser.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/C4/TTParser.pm b/C4/TTParser.pm index e088124684..2ea31a64e2 100755 --- a/C4/TTParser.pm +++ b/C4/TTParser.pm @@ -22,7 +22,6 @@ sub next_token{ #unshift token back on @tokens sub unshift_token{ - my $self = shift; unshift @tokens, shift; } From 77c430717681ad299917db85c878db8f21f2e4dc Mon Sep 17 00:00:00 2001 From: Duncan Tyler Date: Fri, 9 Dec 2011 11:29:53 +1300 Subject: [PATCH 2/2] Added coverage to unit test for TTParser http://bugs.koha-community.org/show_bug.cgi?id=5327 Signed-off-by: Katrin Fischer Test passes. Signed-off-by: Jared Camins-Esakov --- xt/tt_valid.t | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xt/tt_valid.t b/xt/tt_valid.t index ae2e2e5581..97725ee370 100755 --- a/xt/tt_valid.t +++ b/xt/tt_valid.t @@ -19,7 +19,7 @@ use warnings; use strict; -use Test::More tests => 1; +use Test::More tests => 2; use File::Find; use Cwd; use C4::TTParser; @@ -56,6 +56,10 @@ ok( !@files_with_directive_in_tag, "TT syntax: not using TT directive within HTM } @files_with_directive_in_tag ) ); +my $testtoken = 0; +C4::TTParser::unshift_token($testtoken); +my $testtokenagain = C4::TTParser::next_token(); +is( $testtoken, $testtokenagain, "Token received same as original put on stack"); =head1 NAME