Compare commits

...
Author SHA1 Message Date
Graham Ollis 6146b1f2f5 set locale "C" in tests
This ensures that the error string is what we expect it to be
2012-12-26 21:22:07 -05:00
Graham Ollis 5116c191f3 update Changes 2012-12-22 15:14:11 -05:00
Graham Ollis 5828f878d8 don't rely on English locale in test 2012-12-22 15:10:59 -05:00
Graham Ollis f4beaf9864 use non-capturing for performance 2012-12-19 12:33:19 -05:00
3 changed files with 21 additions and 3 deletions
+6
View File
@@ -1,6 +1,12 @@
Revision history for Mojolicious::Plugin::TtRenderer
{{$NEXT}}
- Set locale "C" in tests that rely on it
1.30 December 22, 2012
- Don't rely on English locale in the test t/tt_plugin_lite_app.t
1.29 December 18, 2012
- support multiple renderer paths
1.28 October 11, 2012
+1 -1
View File
@@ -160,7 +160,7 @@ sub not_found { @_ > 1 ? $_[0]->{not_found} = $_[1] : $_[0]->{not_found}
sub _template_modified {
my($self, $template) = @_;
return 1 if $self->SUPER::_template_modified($template);
return $template =~ /^templates(\/|\\)/;
return $template =~ /^templates(?:\/|\\)/;
}
sub _template_content {
+14 -2
View File
@@ -5,6 +5,18 @@
use strict;
use warnings;
BEGIN {
#use if $^O ne 'MSWin32', POSIX => qw/setlocale LC_ALL/;
#setlocale(&LC_ALL, 'C') if $^O ne 'MSWin32';
unless($^O eq 'MSWin32') {
eval q{
use POSIX qw( setlocale LC_ALL );
setlocale(LC_ALL, 'C');
};
warn $@ if $@;
}
}
use File::Temp;
use Mojo::IOLoop;
use Test::More;
@@ -41,7 +53,7 @@ my $t = Test::Mojo->new;
# Simple TT template
$t->get_ok('/')->status_is(200)
->content_like(qr/test123456/);
$t->get_ok('/blow')->status_is(500)->content_like(qr/file error - doesnotexist.tt: No such file or directory/);
$t->get_ok('/blow')->status_is(500)->content_like(qr/file error - doesnotexist\.tt: No such file or directory/);
if(eval q{ use Devel::Cycle; 1 })
{
@@ -56,4 +68,4 @@ if(eval q{ use Devel::Cycle; 1 })
fail('Cycle found')
}
});
};
};