"Fossies" - the Fresh Open Source Software Archive

Member "rt-5.0.2/t/00-mason-syntax.t" (14 Sep 2021, 823 Bytes) of package /linux/misc/rt-5.0.2.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 use strict;
    2 use warnings;
    3 
    4 use RT::Test nodb => 1;
    5 
    6 
    7 use File::Find;
    8 find( {
    9     no_chdir => 1,
   10     wanted   => sub {
   11         return if /(?:\.(?:jpe?g|png|gif|rej)|\~)$/i;
   12         return if m{/\.[^/]+\.sw[op]$}; # vim swap files
   13         return unless -f $_;
   14         local ($@);
   15         ok( eval { compile_file($_) }, "Compiled $File::Find::name ok: $@");
   16     },
   17 }, RT::Test::get_relocatable_dir('../share/html'));
   18 
   19 use HTML::Mason;
   20 use HTML::Mason::Compiler;
   21 use HTML::Mason::Compiler::ToObject;
   22 BEGIN { require RT::Test; }
   23 
   24 sub compile_file {
   25     my $file = shift;
   26 
   27     my $text = Encode::decode( "UTF-8", RT::Test->file_content($file));
   28 
   29     my $compiler = new HTML::Mason::Compiler::ToObject;
   30     $compiler->compile(
   31         comp_source => $text,
   32         name => 'my',
   33         comp_path => 'my',
   34     );
   35     return 1;
   36 }
   37