Subject: | Line numbers in two tests slightly off |
In two of the tests, the line number comments that are generated are
just slightly off. The attached diff fixes the problem for me.
From the test results on cpantesters it looks like this is problem that
created the only failure there.
Unfortunately, it's not clear to me what is causing the problem. It
doesn't seem like Template::Parser has changed how line counting since
last fall.
I'm on Linux, perl 5.8.7 with Template Toolkit 2.15.
Aaron
Subject: | Jemplate-0.18.linenumbers.patch |
diff -u Jemplate-0.18/t/switch.t Jemplate-0.18.linenumbers/t/switch.t
--- Jemplate-0.18/t/switch.t 2006-03-07 04:06:31.000000000 -0800
+++ Jemplate-0.18.linenumbers/t/switch.t 2006-07-05 03:46:29.000000000 -0700
@@ -17,16 +17,16 @@
Zot
--- js
output += 'Foo';
-//line 8 "(unknown template)"
+//line 7 "(unknown template)"
switch(stash.get('foo')) {
case 'Bar':
-//line 5 "(unknown template)"
+//line 4 "(unknown template)"
output += 'Bar';
break;
default:
-//line 7 "(unknown template)"
+//line 6 "(unknown template)"
output += 'Baz';
break;
diff -u Jemplate-0.18/t/while.t Jemplate-0.18.linenumbers/t/while.t
--- Jemplate-0.18/t/while.t 2006-03-07 04:06:31.000000000 -0800
+++ Jemplate-0.18.linenumbers/t/while.t 2006-07-05 03:47:46.000000000 -0700
@@ -18,18 +18,18 @@
[%- END -%]
--- js
output += 'Foo';
-//line 11 "(unknown template)"
+//line 9 "(unknown template)"
// WHILE
var failsafe = 1000;
while (--failsafe && ((stash.get('foo') == 'bar'))) {
-//line 8 "(unknown template)"
+//line 7 "(unknown template)"
if (1 == 2) {
-//line 5 "(unknown template)"
+//line 4 "(unknown template)"
return output;
}
else {
-//line 7 "(unknown template)"
+//line 6 "(unknown template)"
throw('Jemplate.STOP\n' + output);
}
@@ -51,18 +51,18 @@
[%- END -%]
--- js
output += 'Foo';
-//line 11 "(unknown template)"
+//line 9 "(unknown template)"
// WHILE
var failsafe = 1000;
while (--failsafe && ((stash.get('foo') == 'bar'))) {
-//line 8 "(unknown template)"
+//line 7 "(unknown template)"
if (1 == 2) {
-//line 5 "(unknown template)"
+//line 4 "(unknown template)"
continue;
}
else {
-//line 7 "(unknown template)"
+//line 6 "(unknown template)"
break;
}