Added coverage to unit test for TTParser
authorDuncan Tyler <duncan@duncan-SoT.wgtn.cat-it.co.nz>
Thu, 8 Dec 2011 22:29:53 +0000 (11:29 +1300)
committerPaul Poulain <paul.poulain@biblibre.com>
Thu, 12 Jul 2012 14:06:20 +0000 (16:06 +0200)
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test passes.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

C4/TTParser.pm
xt/tt_valid.t

index 5058069..87ad744 100644 (file)
@@ -40,7 +40,6 @@ sub next_token{
 
 #unshift token back on @tokens
 sub unshift_token{
-    my $self = shift;
     unshift @tokens, shift;
 }
 
index ae2e2e5..97725ee 100755 (executable)
@@ -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