X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Ft%2F00-mason-syntax.t;h=e87840ac46a5d3f821d8409e5145918b85f5ce44;hb=01721976fa3324f41a3093cda68bc38a7eec5ff5;hp=0584f630f5ea69ef91ece2ddbffe40c71ceb4bfe;hpb=63a268637b2d51a8766412617724b9436439deb6;p=freeside.git diff --git a/rt/t/00-mason-syntax.t b/rt/t/00-mason-syntax.t index 0584f630f..e87840ac4 100644 --- a/rt/t/00-mason-syntax.t +++ b/rt/t/00-mason-syntax.t @@ -1,43 +1,36 @@ -#!/usr/bin/perl - use strict; use warnings; -use RT::Test tests => 1; +use RT::Test nodb => 1; -my $ok = 1; use File::Find; find( { no_chdir => 1, wanted => sub { return if /(?:\.(?:jpe?g|png|gif|rej)|\~)$/i; - return if m{/\.[^/]+\.swp$}; # vim swap files + return if m{/\.[^/]+\.sw[op]$}; # vim swap files return unless -f $_; - diag "testing $_" if $ENV{'TEST_VERBOSE'}; - eval { compile_file($_) } and return; - $ok = 0; - diag "error in ${File::Find::name}:\n$@"; + local ($@); + ok( eval { compile_file($_) }, "Compiled $File::Find::name ok: $@"); }, }, RT::Test::get_relocatable_dir('../share/html')); -ok($ok, "mason syntax is ok"); use HTML::Mason; use HTML::Mason::Compiler; use HTML::Mason::Compiler::ToObject; BEGIN { require RT::Test; } -use Encode qw(decode_utf8); sub compile_file { my $file = shift; - my $text = decode_utf8(RT::Test->file_content($file)); + my $text = Encode::decode( "UTF-8", RT::Test->file_content($file)); my $compiler = new HTML::Mason::Compiler::ToObject; $compiler->compile( comp_source => $text, name => 'my', - $HTML::Mason::VERSION >= 1.36? (comp_path => 'my'): (), + comp_path => 'my', ); return 1; }