[Templates] breakage of 2.09! (Broken stonehenge.com for a while)

Randal L. Schwartz merlyn@stonehenge.com
23 Apr 2003 14:28:50 -0700


Perl version:

    $ perl -v 
    This is perl, v5.6.1 built for i386-openbsd
    ...

uname:

    OpenBSD red.stonehenge.com 3.2 GENERIC#1 i386

Error I was getting:

    **  error: Template::Constants::ERROR_FILE error - parse error - stonehenge/style/stonehenge line 1-4: unexpected token (=)
      [% PROCESS stonehenge/style/default;
    VIEW stylestonehenge = styledefault; END; %] **

Text of that file:

    [%-
    PROCESS stonehenge/style/html;
    VIEW styledefault base = stylehtml;
      BLOCK body;
        view.top;
        # "<hr>";
        view.main;
        "<hr>";
        view.bottom;
      END;
      BLOCK top; view.navbars; END;
      BLOCK main; content; END;
      BLOCK bottom;
        WRAPPER html/table width='100%' border=0 spacing=0 padding=1 bgcolor='white';
          WRAPPER html/row;
            view.bottom_left WRAPPER html/cell rowspan=2;
            view.bottom_center_top WRAPPER html/cell align='center';
            view.bottom_right WRAPPER html/cell rowspan=2;
          END;
          view.bottom_center_bottom WRAPPER html/row + html/cell align='center';
        END;
      END; # BLOCK bottom
      BLOCK navbars;
        INCLUDE stonehenge/nav_stacked_bars
          class=template.class instance=template.instance;
      END;
      BLOCK bottom_left;
        INCLUDE stonehenge/amazon_button;
      END;
      BLOCK bottom_center_top;
        INCLUDE stonehenge/google_search_this_site;
      END;
      BLOCK bottom_right;
        INCLUDE splash/ttpower;
      END;
      BLOCK bottom_center_bottom;
        INCLUDE stonehenge/most_recently_modified;
      END;
    END; # VIEW styledefault
    -%]

Verbose errors from make test that I shouldn't have ignored: :)

    red.stonehenge.com>> make test TEST_VERBOSE=1
    PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(1, 'blib/lib', 'blib/arch')" t/*.t

... skipped ...

    t/compile3.......1..13
    ok 1
    ok 2
    ok 3
    ok 4
    ok 5
    ok 6 - running test_expect()
    ok 7 - template processor is engaged
    ok 8 - input read and split into 2 tests
    ok 9 - template text 1 processed OK: [% META author => 'albert' versi...
    ok 10 - template text 1 matched expected
    ok 11 - template text 2 processed OK: [%# we want to break 'compile' t...
    MATCH FAILED
     input: [[%# we want to break 'compile' to check that errors get reported -%]\n[% CALL bust_it -%]\n[% TRY; INCLUDE complex; CATCH; "$error"; END %]\n]
    expect: [file error - parse error - complex line 20: unexpected end of input]
    output: [Template::Constants::ERROR_FILE error - parse error - complex line 20: unexpected end of input]
    FAILED 12:  - template text 2 did not match expected
    not ok 12 - template text 2 did not match expected
    ok 13
    FAILED test 12
            Failed 1/13 tests, 92.31% okay

... skipped ...

    t/filter.........1..146
    ok 1 - running test_expect()
    ok 2 - template processor is engaged
    ok 3 - input read and split into 71 tests
    ok 4 - template text 1 processed OK: [% TRY %]\n[% FILTER nonfilt %]\nb...
    ok 5 - template text 1 matched expected
    ok 6 - template text 2 processed OK: [% TRY %]\n[% FILTER badfact %]\nb...
    ok 7 - template text 2 matched expected
    ok 8 - template text 3 processed OK: [% TRY %]\n[% FILTER badfilt %]\nb...
    ok 9 - template text 3 matched expected
    ok 10 - template text 4 processed OK: [% TRY;\n     "foo" | barfilt;\n  ...
    ok 11 - template text 4 matched expected
    ok 12 - template text 5 processed OK: [% TRY;\n     "foo" | barfilt(1);...
    ok 13 - template text 5 matched expected
    ok 14 - template text 6 processed OK: [% TRY;\n     "foo" | barfilt(2);...
    ok 15 - template text 6 matched expected
    ok 16 - template text 7 processed OK: [% TRY;\n     "foo" | barfilt(3);...
    ok 17 - template text 7 matched expected
    ok 18 - template text 8 processed OK: [% FILTER html %]\nThis is some h...
    ok 19 - template text 8 matched expected
    ok 20 - template text 9 processed OK: [% text = "The <cat> sat on the ...
    ok 21 - template text 9 matched expected
    ok 22 - template text 10 processed OK: [% text = "The <cat> sat on the ...
    ok 23 - template text 10 matched expected
    ok 24 - template text 11 processed OK: [% FILTER html %]\n"It isn't what...
    ok 25 - template text 11 matched expected
    ok 26 - template text 12 processed OK: [% FILTER format %]\nHello World!...
    ok 27 - template text 12 matched expected
    ok 28 - template text 13 processed OK: [% FILTER comment = format('<!--...
    ok 29 - template text 13 matched expected
    ok 30 - template text 14 processed OK: [% FILTER format %]\nHello World!...
    ok 31 - template text 14 matched expected
    ok 32 - template text 15 processed OK: [% "Foo" FILTER test1 = format('...
    ok 33 - template text 15 matched expected
    ok 34 - template text 16 processed OK: [% FILTER microjive %]\nThe "Hall...
    ok 35 - template text 16 matched expected
    ok 36 - template text 17 processed OK: [% FILTER microsloth %]\nThe "Hal...
    ok 37 - template text 17 matched expected
    ok 38 - template text 18 processed OK: [% FILTER censor('bottom' 'nippl...
    ok 39 - template text 18 matched expected
    ok 40 - template text 19 processed OK: [% FILTER bold = format('<b>%s</...
    ok 41 - template text 19 matched expected
    ok 42 - template text 20 processed OK: [% "foo" FILTER format("<< %s >>...
    ok 43 - template text 20 matched expected
    ok 44 - template text 21 processed OK: [% blocktext = BLOCK %]\nThe cat ...
    ok 45 - template text 21 matched expected
    ok 46 - template text 22 processed OK: [% global.blocktext FILTER html_...
    ok 47 - template text 22 matched expected
    ok 48 - template text 23 processed OK: [% global.blocktext FILTER html_...
    ok 49 - template text 23 matched expected
    ok 50 - template text 24 processed OK: [% global.blocktext FILTER html_...
    ok 51 - template text 24 matched expected
    ok 52 - template text 25 processed OK: [% global.blocktext FILTER html_...
    ok 53 - template text 25 matched expected
    ok 54 - template text 26 processed OK: [% global.blocktext FILTER trunc...
    ok 55 - template text 26 matched expected
    ok 56 - template text 27 processed OK: [% global.blocktext FILTER trunc...
    ok 57 - template text 27 matched expected
    ok 58 - template text 28 processed OK: [% 'Hello World' | truncate(8) +...
    ok 59 - template text 28 matched expected
    ok 60 - template text 29 processed OK: [% "foo..." FILTER repeat(5) %]
    ok 61 - template text 29 matched expected
    ok 62 - template text 30 processed OK: [% FILTER truncate(21) %]\nI have...
    ok 63 - template text 30 matched expected
    ok 64 - template text 31 processed OK: [% FILTER truncate(25) %]\nNothin...
    ok 65 - template text 31 matched expected
    ok 66 - template text 32 processed OK: [% FILTER repeat(3) %]\nAm I repe...
    ok 67 - template text 32 matched expected
    ok 68 - template text 33 processed OK: [% text FILTER remove(' ') +%]\n[...
    ok 69 - template text 33 matched expected
    ok 70 - template text 34 processed OK: [% text FILTER replace(' ', '_')...
    ok 71 - template text 34 matched expected
    ok 72 - template text 35 processed OK: [% text = 'The <=> operator' %]\n...
    ok 73 - template text 35 matched expected
    ok 74 - template text 36 processed OK: [% text = 'The <=> operator, bla...
    ok 75 - template text 36 matched expected
    ok 76 - template text 37 processed OK: [% | truncate(25) %]\nThe cat sat...
    ok 77 - template text 37 matched expected
    ok 78 - template text 38 processed OK: [% FILTER upper %]\nThe cat sat o...
    ok 79 - template text 38 matched expected
    ok 80 - template text 39 processed OK: [% FILTER lower %]\nThe cat sat o...
    ok 81 - template text 39 matched expected
    ok 82 - template text 40 processed OK: [% 'arse' | stderr %]\nstderr: [%...
    ok 83 - template text 40 matched expected
    ok 84 - template text 41 processed OK: [% percent = '%'\n   left    = "[...
    ok 85 - template text 41 matched expected
    ok 86 - template text 42 processed OK: [% TRY %]\n[% dir = "[\% FOREACH ...
    MATCH FAILED
     input: [[% TRY %]\n[% dir = "[\% FOREACH a = { 1 2 3 } %\]a: [\% a %\]\n[\% END %\]" %]\n[% dir | eval %]\n[% CATCH %]\nerror: [[% error.type %]] [[% error.info %]]\n[% END %]\n]
    expect: [error: [file] [parse error - input text line 1: unexpected token (1)\n  [% FOREACH a = { 1 2 3 } %]]]
    output: [error: [Template::Constants::ERROR_FILE] [parse error - input text line 1: unexpected token (1)\n  [% FOREACH a = { 1 2 3 } %]]]
    not ok 87 - template text 42 did not match expected
    ok 88 - template text 43 processed OK: nothing\n[% TRY;\n    '$x = 10; $b...
    ok 89 - template text 43 matched expected
    ok 90 - template text 44 processed OK: [% TRY -%]\nbefore\n[% FILTER redi...
    ok 91 - template text 44 matched expected
    ok 92 - template text 45 processed OK: [% FILTER evalperl %]\n   $a = 10...
    ok 93 - template text 45 matched expected
    ok 94 - template text 46 processed OK: [% TRY -%]\nbefore\n[% FILTER file...
    ok 95 - template text 46 matched expected
    ok 96 - template text 47 processed OK: [% PERL %]\n$Template::Filters::F...
    ok 97 - template text 47 matched expected
    ok 98 - template text 48 processed OK: [% PERL %]\n$Template::Filters::F...
    ok 99 - template text 48 matched expected
    ok 100 - template text 49 processed OK: [% PERL %]\n$stash->set('merlyn',...
    ok 101 - template text 49 matched expected
    ok 102 - template text 50 processed OK: [% PERL %]\n$stash->set('merlyn',...
    ok 103 - template text 50 matched expected
    ok 104 - template text 51 processed OK: [% myfilter = 'html' -%]\n[% FILT...
    ok 105 - template text 51 matched expected
    ok 106 - template text 52 processed OK: [% FILTER $despace -%]\nblah blah...
    ok 107 - template text 52 matched expected
    ok 108 - template text 53 processed OK: [% PERL %]\n$context->filter(\&ne...
    ok 109 - template text 53 matched expected
    ok 110 - template text 54 processed OK: [% PERL %]\n$context->define_filt...
    ok 111 - template text 54 matched expected
    ok 112 - template text 55 processed OK: [% FILTER another(3) -%]\nfoo bar...
    ok 113 - template text 55 matched expected
    ok 114 - template text 56 processed OK: [% '$stash->{ a } = 25' FILTER e...
    ok 115 - template text 56 matched expected
    ok 116 - template text 57 processed OK: [% '$stash->{ a } = 25' FILTER p...
    ok 117 - template text 57 matched expected
    ok 118 - template text 58 processed OK: [% FILTER indent -%]\nThe cat sat...
    ok 119 - template text 58 matched expected
    ok 120 - template text 59 processed OK: [% FILTER indent(2) -%]\nThe cat ...
    ok 121 - template text 59 matched expected
    ok 122 - template text 60 processed OK: [% FILTER indent('>> ') -%]\nThe ...
    ok 123 - template text 60 matched expected
    ok 124 - template text 61 processed OK: [% text = 'The cat sat on the ma...
    ok 125 - template text 61 matched expected
    ok 126 - template text 62 processed OK: <<[% FILTER trim %]\n   \n        ...
    ok 127 - template text 62 matched expected
    ok 128 - template text 63 processed OK: <<[% FILTER collapse %]\n   \n    ...
    ok 129 - template text 63 matched expected
    ok 130 - template text 64 processed OK: [% FILTER format('++%s++') %]Hel...
    ok 131 - template text 64 matched expected
    ok 132 - template text 65 processed OK: [% "my file.html" FILTER uri %]
    ok 133 - template text 65 matched expected
    ok 134 - template text 66 processed OK: [% "my<file & your>file.html" FI...
    ok 135 - template text 66 matched expected
    ok 136 - template text 67 processed OK: [% "my<file & your>file.html" | ...
    ok 137 - template text 67 matched expected
    ok 138 - template text 68 processed OK: [% "guitar&amp;file.html" | uri ...
    ok 139 - template text 68 matched expected
    ok 140 - template text 69 processed OK: [% "guitar&amp;file.html" | uri ...
    ok 141 - template text 69 matched expected
    ok 142 - template text 70 processed OK: [% 'foobar' | ucfirst %]
    ok 143 - template text 70 matched expected
    ok 144 - template text 71 processed OK: [% 'FOOBAR' | lcfirst %]
    ok 145 - template text 71 matched expected
    ok 146 - t/test/tmp/xyz exists
    FAILED test 87
            Failed 1/146 tests, 99.32% okay

... skipped ...

    t/provider.......1..56
    ok 1
    ok 2
    ok 3
    ok 4
    ok 5
    ok 6
    ok 7
    ok 8
    ok 9
    ok 10
    ok 11
    ok 12
    ok 13
    ok 14
    ok 15
    ok 16
    ok 17
    ok 18
    ok 19 - dynamic path (sub) template object created
    ok 20 - dynamic path (obj) template object created
    ok 21 - dynamic path (bad) template object created
    ok 22 - running test_expect()
    ok 23 - template processor is engaged
    ok 24 - input read and split into 16 tests
    ok 25 - template text 1 processed OK: [% TRY %]\n[% INCLUDE foo %]\n[% I...
    ok 26 - template text 1 matched expected
    ok 27 - template text 2 processed OK: [% TRY %]\n[% INCLUDE foo %]\n[% I...
    ok 28 - template text 2 matched expected
    ok 29 - template text 3 processed OK: [% TRY %]\n[% INSERT foo +%]\n[% I...
    ok 30 - template text 3 matched expected
    ok 31 - template text 4 processed OK: [% TRY %]\n[% INCLUDE $relfile %]...
    ok 32 - template text 4 matched expected
    Template process failed: Template::Constants::ERROR_FILE error - /usr/libdata/perl5-CPAN/build/Template-Toolkit-2.09/t/test/src/foo: absolute paths are not allowed (set ABSOLUTE option)
    FAILED 33:  - template text 5 process FAILED: [% TRY %]\n[% INCLUDE $relfile -%...
    not ok 33 - template text 5 process FAILED: [% TRY %]\n[% INCLUDE $relfile -%...
    FAILED 34:  - (obviously did not match expected)
    not ok 34 - (obviously did not match expected)
    ok 35 - template text 6 processed OK: foo: [% TRY; INSERT foo;      CA...
    ok 36 - template text 6 matched expected
    ok 37 - template text 7 processed OK: [% TRY %]\n[% INCLUDE $absfile %]...
    ok 38 - template text 7 matched expected
    Template process failed: Template::Constants::ERROR_FILE error - ./t/test/src/foo: relative paths are not allowed (set RELATIVE option)
    FAILED 39:  - template text 8 process FAILED: [% TRY %]\n[% INCLUDE $absfile %]...
    not ok 39 - template text 8 process FAILED: [% TRY %]\n[% INCLUDE $absfile %]...
    FAILED 40:  - (obviously did not match expected)
    not ok 40 - (obviously did not match expected)
    ok 41 - template text 9 processed OK: foo: [% TRY; INSERT foo;      CA...
    ok 42 - template text 9 matched expected
    ok 43 - template text 10 processed OK: [% INCLUDE foobar %]
    ok 44 - template text 10 matched expected
    ok 45 - template text 11 processed OK: [% CALL fixfile('This is the new...
    ok 46 - template text 11 matched expected
    ok 47 - template text 12 processed OK: foo: [% PROCESS foo | trim +%]\nb...
    ok 48 - template text 12 matched expected
    ok 49 - template text 13 processed OK: foo: [% INSERT foo | trim +%]\nba...
    ok 50 - template text 13 matched expected
    ok 51 - template text 14 processed OK: foo: [% PROCESS foo | trim +%]\nb...
    ok 52 - template text 14 matched expected
    ok 53 - template text 15 processed OK: foo: [% INSERT foo | trim +%]\nba...
    ok 54 - template text 15 matched expected
    ok 55 - template text 16 processed OK: [% TRY; INCLUDE foo; CATCH; e; E...
    MATCH FAILED
     input: [[% TRY; INCLUDE foo; CATCH; e; END %]\n]
    expect: [file error - INCLUDE_PATH exceeds 42 directories]
    output: [Template::Constants::ERROR_FILE error - INCLUDE_PATH exceeds 42 directories]
    FAILED 56:  - template text 16 did not match expected
    not ok 56 - template text 16 did not match expected
    FAILED tests 33-34, 39-40, 56
            Failed 5/56 tests, 91.07% okay

... skipped ...

    Failed Test  Stat Wstat Total Fail  Failed  List of Failed
    -------------------------------------------------------------------------------
    t/compile3.t               13    1   7.69%  12
    t/filter.t                146    1   0.68%  87
    t/gd.t                     11    1   9.09%  5
    t/provider.t               56    5   8.93%  33-34 39-40 56
    4 tests skipped.
    Failed 4/90 test scripts, 95.56% okay. 8/2577 subtests failed, 99.69% okay.
    *** Error code 35

I didn't show the gd test.... that's known.

So, what did ya break, Andy?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!