Subject: | t/javascript.t depends on locale |
t/javascript.t is failed not English locale system, such as Japanese.
I got following error.
# Failed test 'could not find include file'
# at t/javascript.t line 68.
# 'read_file 'nonexistent file' - sysopen: そのようなファイルやディレクトリはありません at /home/syohei/Desktop/File-HashCache-v1.0.1/blib/lib/File/HashCache.pm line 29.
# '
# doesn't match '(?^:nonexistent file.*No such file or directory)'
Because error message depends on locale. This test expects English
message "No such file or directory". I think that you should use
Errno module and check errno value in such case.
Please check this patch.
Subject: | errno.patch |
diff --git a/t/javascript.t b/t/javascript.t
index e9c340c..1fabe3d 100644
--- a/t/javascript.t
+++ b/t/javascript.t
@@ -11,6 +11,7 @@ use Test::More tests => 18;
use File::HashCache::JavaScript;
use File::Temp qw(tempdir);
use File::Slurp qw(write_file);
+use Errno ();
my $dir = tempdir();
sub file_with_contents($$) {
@@ -65,7 +66,7 @@ var f=3;
EOF
eval { $jsh->hash($filec) };
-like($@, qr/nonexistent file.*No such file or directory/, 'could not find include file');
+ok($! == Errno::ENOENT, 'could not find include file');
sleep(1); # Weak! mtime must not be very high resolution.
write_file($filea, <<EOF);