diff options
author | Eric Wong <e@80x24.org> | 2021-04-28 07:51:56 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-04-28 19:30:54 +0000 |
commit | 5e788baf14bd99cc7e428432479eae374343525a (patch) | |
tree | 8f783b751993a96b195c40480e36b14ef063dc58 /t | |
parent | c8183449e73a94f02a63778bf4d1c70a3ec2a0df (diff) | |
download | public-inbox-5e788baf14bd99cc7e428432479eae374343525a.tar.gz |
This simplifies test_lei users in t/*.t
Diffstat (limited to 't')
-rw-r--r-- | t/lei-externals.t | 5 | ||||
-rw-r--r-- | t/lei-q-save.t | 4 | ||||
-rw-r--r-- | t/solver_git.t | 5 |
3 files changed, 0 insertions, 14 deletions
diff --git a/t/lei-externals.t b/t/lei-externals.t index 2291dd99..16241e02 100644 --- a/t/lei-externals.t +++ b/t/lei-externals.t @@ -4,7 +4,6 @@ use strict; use v5.10.1; use PublicInbox::TestCommon; use Fcntl qw(SEEK_SET); use PublicInbox::Spawn qw(which); -use PublicInbox::OnDestroy; require_git 2.6; require_mods(qw(json DBD::SQLite Search::Xapian)); use POSIX qw(WTERMSIG WIFSIGNALED SIGPIPE); @@ -266,10 +265,6 @@ test_lei(sub { { skip 'TEST_LEI_DAEMON_PERSIST_DIR in use', 1 if $ENV{TEST_LEI_DAEMON_PERSIST_DIR}; - opendir my $dh, '.' or BAIL_OUT "opendir(.) $!"; - my $od = PublicInbox::OnDestroy->new($$, sub { - chdir $dh or BAIL_OUT "chdir: $!" - }); my @q = qw(q -o mboxcl2:rel.mboxcl2 bye); lei_ok('-C', $home, @q); is(unlink("$home/rel.mboxcl2"), 1, '-C works before q'); diff --git a/t/lei-q-save.t b/t/lei-q-save.t index 170f7ce5..9f65e4a2 100644 --- a/t/lei-q-save.t +++ b/t/lei-q-save.t @@ -36,11 +36,9 @@ test_lei(sub { # ensure "lei up" works, since it compliments "lei q --save" $in = $doc2->as_string; lei_ok [qw(import -q -F eml -)], undef, { 0 => \$in, %$lei_opt }; - opendir my $dh, '.' or xbail "opendir .: $!"; lei_ok qw(up -q md -C), $home; lei_ok qw(up -q . -C), "$home/md"; lei_ok qw(up -q), "/$home/md"; - chdir($dh) or xbail "fchdir . $!"; my %after = map { $_ => 1 } glob("$home/md/cur/*"); is(delete $after{(keys(%before))[0]}, 1, 'original message kept'); is(scalar(keys %after), 1, 'one new message added'); @@ -89,7 +87,6 @@ test_lei(sub { print $mb $pre_existing; close $mb or xbail "close: $!"; lei_ok(qw(q --save -o mboxrd:mbrd m:qp@example.com -C), $home); - chdir($dh) or xbail "fchdir . $!"; open $mb, '<', "$home/mbrd" or xbail "open $!"; is_deeply([grep(/pre-existing/, <$mb>)], [], 'pre-existing messsage gone w/o augment'); @@ -103,7 +100,6 @@ test_lei(sub { print $mb $pre_existing; close $mb or xbail "close: $!"; lei_ok(qw(q -a --save -o mboxrd:mbrd-aug m:qp@example.com -C), $home); - chdir($dh) or xbail "fchdir . $!"; open $mb, '<', "$home/mbrd-aug" or xbail "open $!"; $mb = do { local $/; <$mb> }; like($mb, qr/pre-existing/, 'pre-existing message preserved w/ -a'); diff --git a/t/solver_git.t b/t/solver_git.t index 8acf907f..6875e26b 100644 --- a/t/solver_git.t +++ b/t/solver_git.t @@ -50,11 +50,6 @@ test_lei({tmpdir => $tmpdir}, sub { 'non-existent blob fails'); SKIP: { skip '/.git exists', 1 if -e '/.git'; - require PublicInbox::OnDestroy; - opendir my $dh, '.' or xbail "opendir: $!"; - my $end = PublicInbox::OnDestroy->new($$, sub { - chdir $dh or xbail "chdir: $!"; - }); lei_ok(qw(-C / blob 69df7d5 -I), $ibx->{inboxdir}, "--git-dir=$git_dir"); is($lei_out, $prev, '--git-dir works'); |