diff options
author | ivan <ivan> | 2007-08-02 19:56:20 +0000 |
---|---|---|
committer | ivan <ivan> | 2007-08-02 19:56:20 +0000 |
commit | 9509e5bfb7f9331303153cac24d7bfecbe2ea9f1 (patch) | |
tree | 7ff1dce47668339f41f0ddea0e31e85d7788d4df /rt/lib/t/regression/00-mason-syntax.t | |
parent | b052ee7b17d87c95f650857989b33ecffc9089c5 (diff) | |
parent | ef20b2b6b1feb47ad02b5ff7525f1a0fd11d0fa4 (diff) |
This commit was generated by cvs2svn to compensate for changes in r5562,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'rt/lib/t/regression/00-mason-syntax.t')
-rw-r--r-- | rt/lib/t/regression/00-mason-syntax.t | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/rt/lib/t/regression/00-mason-syntax.t b/rt/lib/t/regression/00-mason-syntax.t new file mode 100644 index 000000000..96674cacf --- /dev/null +++ b/rt/lib/t/regression/00-mason-syntax.t @@ -0,0 +1,42 @@ +#!/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|rej|\~)$/i; + if (m!/\.svn$!) { + $File::Find::prune = 1; + return; + } + 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; +} + |