[Rt-commit] r6446 - in rt/branches/3.6-RELEASE: sbin

ruz at bestpractical.com ruz at bestpractical.com
Thu Nov 16 11:28:29 EST 2006


Author: ruz
Date: Thu Nov 16 11:28:28 2006
New Revision: 6446

Added:
   rt/branches/3.6-RELEASE/lib/t/regression/00-mason-syntax.t
Modified:
   rt/branches/3.6-RELEASE/sbin/rt-test-dependencies.in

Log:
* test syntax of comps with a mason compiler

Added: rt/branches/3.6-RELEASE/lib/t/regression/00-mason-syntax.t
==============================================================================
--- (empty file)
+++ rt/branches/3.6-RELEASE/lib/t/regression/00-mason-syntax.t	Thu Nov 16 11:28:28 2006
@@ -0,0 +1,38 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+my $ok = 1;
+
+use File::Find;
+find( {
+    no_chdir => 1,
+    wanted   => sub {
+        return if /\.(?:jpe?g|png|gif)$/i;
+        return unless -f $_;
+        diag "testing $_" if $ENV{'TEST_VERBOSE'};
+        eval { compile_file($_) } and return;
+        $ok = 0;
+        diag "error in ${File::Find::name}:\n$@";
+    },
+}, 'html');
+ok($ok, "mason syntax is ok");
+
+use HTML::Mason::Compiler;
+use HTML::Mason::Compiler::ToObject;
+
+sub compile_file {
+    my $file = shift;
+
+    open my $fh, '<:utf8', $file or die "couldn't open '$file': $!";
+    my $text = do { local $/; <$fh> };
+    close $fh or die "couldn't close '$file': $!";
+
+    my $compiler = new HTML::Mason::Compiler::ToObject;
+    $compiler->compile( comp_source => $text, name => 'my' );
+    return 1;
+}
+

Modified: rt/branches/3.6-RELEASE/sbin/rt-test-dependencies.in
==============================================================================
--- rt/branches/3.6-RELEASE/sbin/rt-test-dependencies.in	(original)
+++ rt/branches/3.6-RELEASE/sbin/rt-test-dependencies.in	Thu Nov 16 11:28:28 2006
@@ -231,6 +231,7 @@
 Module::Refresh 0.03
 Test::Expect 0.30
 XML::Simple
+File::Find
 .
 
 $deps{'FASTCGI'} = [ _( << '.') ];


More information about the Rt-commit mailing list