From 5bf117cbae57247a736043496c49bd6c920d131a Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Sat, 13 Oct 2012 01:23:35 -0400 Subject: [PATCH] Tests: Ensure TT2 templates parse cleanly File::Find and Test::Output make it easy to check for any stderr returned from the TT2 extractor. Signed-off-by: Dan Scott Signed-off-by: Bill Erickson --- .../perlmods/t/22-template-toolkit-parse.t | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Open-ILS/src/perlmods/t/22-template-toolkit-parse.t diff --git a/Open-ILS/src/perlmods/t/22-template-toolkit-parse.t b/Open-ILS/src/perlmods/t/22-template-toolkit-parse.t new file mode 100644 index 0000000000..08304f66e0 --- /dev/null +++ b/Open-ILS/src/perlmods/t/22-template-toolkit-parse.t @@ -0,0 +1,28 @@ +use strict; +use warnings; +use File::Find; +use File::Spec; +use Locale::Maketext::Extract; +use Test::More; +use Test::Output; + +my $num_tests = 0; + +my $ext = Locale::Maketext::Extract->new( + plugins => { tt2 => ['tt2'] }, + warnings => 1, + verbose => 0 +); + +sub template_checker { + return unless /.tt2$/; + my $tt2 = $_; + $num_tests++; + stderr_is {$ext->extract_file($tt2)} '', "Parse TT2 - $File::Find::name"; +} + +my ($vol, $dir, $file) = File::Spec->splitpath(__FILE__); +chdir("$dir/../.."); +find(\&template_checker, ('templates')); + +done_testing($num_tests); -- 2.43.2