[Rt-commit] r6438 - in rt/branches/3.7-EXPERIMENTAL: . sbin
ruz at bestpractical.com
ruz at bestpractical.com
Wed Nov 15 23:56:38 EST 2006
Author: ruz
Date: Wed Nov 15 23:56:38 2006
New Revision: 6438
Added:
rt/branches/3.7-EXPERIMENTAL/lib/t/regression/00-mason-syntax.t
Modified:
rt/branches/3.7-EXPERIMENTAL/ (props changed)
rt/branches/3.7-EXPERIMENTAL/sbin/rt-test-dependencies.in
Log:
r4156 at cubic-pc: cubic | 2006-11-16 08:06:46 +0300
* test syntax of comps with a mason compiler
Added: rt/branches/3.7-EXPERIMENTAL/lib/t/regression/00-mason-syntax.t
==============================================================================
--- (empty file)
+++ rt/branches/3.7-EXPERIMENTAL/lib/t/regression/00-mason-syntax.t Wed Nov 15 23:56:38 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.7-EXPERIMENTAL/sbin/rt-test-dependencies.in
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/sbin/rt-test-dependencies.in (original)
+++ rt/branches/3.7-EXPERIMENTAL/sbin/rt-test-dependencies.in Wed Nov 15 23:56:38 2006
@@ -251,6 +251,8 @@
Test::WWW::Mechanize 1.04
Module::Refresh 0.03
Test::Expect 0.30
+Pod::Tests
+File::Find
.
$deps{'FASTCGI'} = [ text_to_hash( << '.') ];
More information about the Rt-commit
mailing list