Subject: | 't/integration_test.t' depends on locale |
t/intefration_test.t is failed on my platform(LANG=ja_JP.UTF8).
I got follow message:
# Failed test '...with correct error'
# at t/integration_test.t line 97.
# 'read_file '/etc/this/really/should/not/exist.js' -
sysopen: そのようなファイルやディレクトリはありません at
/home/syohei/.cpanm/work/1312333117.30611/tms/WebService-Google-Closure-0.09/blib/lib/WebService/Google/Closure.pm
line 77
# '
# doesn't match '(?-xism:No such file)'
# Looks like you failed 1 test of 20.
I got Japanese error message, not English,
because my locale is Japanese.
I suggest that checking ERRNO is better than checking error message.
I attach patch that fixes this issue. Please see it.
Thanks.
Subject: | integration_test.t.patch |
diff --git a/t/integration_test.t b/t/integration_test.t
index eae8480..c934f78 100644
--- a/t/integration_test.t
+++ b/t/integration_test.t
@@ -5,6 +5,7 @@
use strict;
use warnings;
use Test::More tests => 20;
+use Errno qw(ENOENT);
use WebService::Google::Closure;
@@ -94,5 +95,5 @@ sub test_with_file_fail {
)->compile;
};
ok($@, "Compilation died with bad filename");
- like($@,qr{No such file},"...with correct error");
+ ok($! == ENOENT, "...with correct error");
}