diff options
author | Eric Wong <e@80x24.org> | 2023-11-15 04:32:39 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-11-15 08:02:57 +0000 |
commit | 4bf3fe6a811c6e024af3580f2da15c234fb53011 (patch) | |
tree | 6ba664947cc5cbe2cec26e065dff02071b6c706f /lib/PublicInbox/TestCommon.pm | |
parent | 7d06b126e9395d96a03b37daf49019925ff0ec76 (diff) | |
download | public-inbox-4bf3fe6a811c6e024af3580f2da15c234fb53011.tar.gz |
Avoid mixing autodie use in different scopes since it's likely to cause problems like it did in Gcf2. While none of these fix known problems with test cases, it's likely worthwhile to avoid it anyways to avoid future surprises. For Process::IO, we'll add some additional tests in t/io.t to ensure we don't get unintended exceptions for try_cat.
Diffstat (limited to 'lib/PublicInbox/TestCommon.pm')
-rw-r--r-- | lib/PublicInbox/TestCommon.pm | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm index a5546905..8bfa30f2 100644 --- a/lib/PublicInbox/TestCommon.pm +++ b/lib/PublicInbox/TestCommon.pm @@ -16,7 +16,7 @@ our @EXPORT; my $lei_loud = $ENV{TEST_LEI_ERR_LOUD}; my $tail_cmd = $ENV{TAIL}; our ($lei_opt, $lei_out, $lei_err); -use autodie qw(chdir close fcntl open opendir seek unlink); +use autodie qw(chdir close fcntl mkdir open opendir seek unlink); $_ = File::Spec->rel2abs($_) for (grep(!m!^/!, @INC)); @@ -670,7 +670,6 @@ sub test_lei { SKIP: { my ($cb) = pop @_; my $test_opt = shift // {}; - use autodie qw(mkdir); require_git(2.6, 1); my $mods = $test_opt->{mods} // [ 'lei' ]; require_mods(@$mods, 2); @@ -801,7 +800,7 @@ sub create_coderepo ($$;@) { my ($db) = (PublicInbox::Import::default_branch() =~ m!([^/]+)\z!); my $dir = "t/data-gen/$base.$ident-$db"; my $new = !-d $dir; - if ($new && !mkdir($dir)) { + if ($new && !CORE::mkdir($dir)) { my $err = $!; -d $dir or xbail "mkdir($dir): $err"; } |