CC: | casiano.rodriguez.leon [...] gmail.com |
Subject: | tests and non declared variable |
Many thanks for the module.
As mentioned by other users, the tests fail. There is also a non
declared variable in file /Parse/Template.pm that generates errors.
I have addressed this issues in the enclosed patch file.
To apply it, you can use a command like:
/tmp/ParseLex-2.15$ patch -p1 < ../ParseLex_t_and_var_bugs.patch
Hope it helps
Casiano
Subject: | ParseLex_t_and_var_bugs.patch |
Only in ParseLex-2.16: Makefile
Only in ParseLex-2.16: ParseLex-2.16.tar.gz
Only in ParseLex-2.16: blib
Only in ParseLex-2.16: deb
Only in ParseLex-2.16: err
Only in ParseLex-2.16/examples: .tokenizer.pl.swp
diff -ur ParseLex-2.15/examples/ctokenizer.pl ParseLex-2.16/examples/ctokenizer.pl
--- ParseLex-2.15/examples/ctokenizer.pl 1999-09-23 09:16:24.000000000 +0100
+++ ParseLex-2.16/examples/ctokenizer.pl 2009-08-24 11:17:21.000000000 +0100
@@ -18,7 +18,7 @@
}
);
-Parse::CLex->trace;
+#Parse::CLex->trace;
$lexer = Parse::CLex->new(@token);
$lexer->from(\*DATA);
Only in ParseLex-2.16/lib/Parse: .Template.pm.swp
diff -ur ParseLex-2.15/lib/Parse/ALex.pm ParseLex-2.16/lib/Parse/ALex.pm
--- ParseLex-2.15/lib/Parse/ALex.pm 1999-09-27 12:36:51.000000000 +0100
+++ ParseLex-2.16/lib/Parse/ALex.pm 2009-08-24 12:13:48.000000000 +0100
@@ -16,7 +16,7 @@
use strict qw(subs);
package Parse::ALex;
-$Parse::ALex::VERSION = '2.15';
+$Parse::ALex::VERSION = '2.16';
use Parse::Trace;
@Parse::ALex::ISA = qw(Parse::Trace);
diff -ur ParseLex-2.15/lib/Parse/Template.pm ParseLex-2.16/lib/Parse/Template.pm
--- ParseLex-2.15/lib/Parse/Template.pm 1999-09-23 09:16:28.000000000 +0100
+++ ParseLex-2.16/lib/Parse/Template.pm 2009-08-24 10:58:25.000000000 +0100
@@ -1,4 +1,4 @@
-use strict
+use strict;
require 5.004;
package Parse::Template;
$Parse::Template::VERSION = '0.32';
@@ -132,7 +132,7 @@
}
# evaluated expressions are not always available in (caller(1))[6];
if (defined($1) and $1 ne '') {
- $expr = $1; # what is the template expression?
+ my $expr = $1; # what is the template expression?
{ package DB; # what is the part name?
@DB::caller = caller(2); # why is this needed? /ee?
@DB::caller = caller(1);
Only in ParseLex-2.16: pm_to_blib
Only in ParseLex-2.16: salida
Only in ParseLex-2.16/t: .W.pm.swp
Only in ParseLex-2.16/t: .test1.t.swp
Only in ParseLex-2.16/t: .test4.t.swp
diff -ur ParseLex-2.15/t/W.pm ParseLex-2.16/t/W.pm
--- ParseLex-2.15/t/W.pm 1999-09-23 09:16:25.000000000 +0100
+++ ParseLex-2.16/t/W.pm 2009-08-24 11:52:15.000000000 +0100
@@ -31,7 +31,7 @@
local *SAVE_STDERR;
open(SAVE_STDERR, ">&STDERR");
open STDERR, "> err";
- open( CMD, "$^X $cmd |" ) or warn "$0: Can't run. $!\n";
+ open( CMD, "$^X -Ilib $cmd |" ) or warn "$0: Can't run. $!\n";
@result = <CMD>;
close CMD;
close STDERR;
diff -ur ParseLex-2.15/t/test1.t ParseLex-2.16/t/test1.t
--- ParseLex-2.15/t/test1.t 1999-09-27 12:25:19.000000000 +0100
+++ ParseLex-2.16/t/test1.t 2009-08-24 12:23:41.000000000 +0100
@@ -11,10 +11,10 @@
print $test->report(1, sub {
my $expectation = $test->expected;
my $result = $test->result;
- $expectation =~ s/\s+$//;
#print STDERR "Result:\n$result\n";
#print STDERR "Expectation:\n$expectation\n";
- $result =~ s/\s+$//;
+ $expectation =~ s/\s+//g;
+ $result =~ s/\s+//g;
$expectation eq $result;
});
@@ -39,7 +39,7 @@
Record number: 3
Type: NEWLINE Content:->
<-
-Version 2.15
+Version 2.16
Trace is ON in class Parse::Lex
[main::lexer|Parse::Lex] Token read (INTEGER, [1-9][0-9]*): 1
[main::lexer|Parse::Lex] Token read (ADDOP, [-+]): +
diff -ur ParseLex-2.15/t/test4.t ParseLex-2.16/t/test4.t
--- ParseLex-2.15/t/test4.t 1999-09-23 09:16:26.000000000 +0100
+++ ParseLex-2.16/t/test4.t 2009-08-24 12:09:07.000000000 +0100
@@ -10,8 +10,8 @@
print $test->report(1, sub {
my $expectation = $test->expected;
my $result = $test->result;
- $expectation =~ s/\s+$//;
- $result =~ s/\s+$//;
+ $expectation =~ s/\s+//g;
+ $result =~ s/\s+//g;
unless ($expectation eq $result) {
print "$result\n" if $ENV{TEST_VERBOSE};
0;
@@ -21,6 +21,7 @@
});
__END__
+
Tokenization of DATA:
Record number: 1
Type: INTEGER Content:->1<-
@@ -41,17 +42,4 @@
Record number: 3
Type: NEWLINE Content:->
<-
-Trace is ON in class Parse::CLex
-[main::lexer|Parse::CLex] Token read (INTEGER, [1-9][0-9]*): 1
-[main::lexer|Parse::CLex] Token read (ADDOP, [-+]): +
-[main::lexer|Parse::CLex] Token read (INTEGER, [1-9][0-9]*): 2
-[main::lexer|Parse::CLex] Token read (ADDOP, [-+]): -
-[main::lexer|Parse::CLex] Token read (INTEGER, [1-9][0-9]*): 5
-[main::lexer|Parse::CLex] Token read (NEWLINE, \n):
-
-[main::lexer|Parse::CLex] Token read (STRING, \"(?:[^\"]+|\"\")*\"): "This is a multiline
-string with an embedded "" in it"
-[main::lexer|Parse::CLex] Token read (NEWLINE, \n):
-
-[main::lexer|Parse::CLex] Token read (ERROR, .*): this is an invalid string with a "" in it"
-can't analyze: "this is an invalid string with a "" in it"" at examples/ctokenizer.pl line 17, <DATA> chunk 4.
+can't analyze: "this is an invalid string with a "" in it"" at examples/ctokenizer.pl line 17, <DATA> line 4.
Only in ParseLex-2.16: testlog