about summary refs log tree commit homepage
path: root/t/solver_git.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-12-18 03:36:43 +0000
committerEric Wong <e@80x24.org>2019-12-19 03:59:17 +0000
commit684d26cecc0891261783be179909b0e434692b25 (patch)
treea1d78c9f23792d0272ee542c06cd347b848cffc6 /t/solver_git.t
parent55b11c59936125aab26694e17631828c7ea9954e (diff)
downloadpublic-inbox-684d26cecc0891261783be179909b0e434692b25.tar.gz
These usages of file-local global variables make the *.t files
incompatible with run_script().  Instead, use anonymous subs,
"our", or pass the parameter as appropriate.
Diffstat (limited to 't/solver_git.t')
-rw-r--r--t/solver_git.t9
1 files changed, 5 insertions, 4 deletions
diff --git a/t/solver_git.t b/t/solver_git.t
index 6bac17ea..88f83bdb 100644
--- a/t/solver_git.t
+++ b/t/solver_git.t
@@ -32,15 +32,16 @@ my $ibx = PublicInbox::Inbox->new($opts);
 my $im = PublicInbox::V2Writable->new($ibx, 1);
 $im->{parallel} = 0;
 
-sub deliver_patch ($) {
+my $deliver_patch = sub ($) {
         open my $fh, '<', $_[0] or die "open: $!";
         my $mime = PublicInbox::MIME->new(do { local $/; <$fh> });
         $im->add($mime);
         $im->done;
-}
+};
 
-deliver_patch('t/solve/0001-simple-mod.patch');
+$deliver_patch->('t/solve/0001-simple-mod.patch');
 my $v1_0_0_tag = 'cb7c42b1e15577ed2215356a2bf925aef59cdd8d';
+
 my $git = PublicInbox::Git->new($git_dir);
 is('public-inbox 1.0.0',
         $git->commit_title($v1_0_0_tag),
@@ -96,7 +97,7 @@ $solver = PublicInbox::SolverGit->new($ibx, sub { $res = $_[0] });
 $solver->solve($psgi_env, $log, $git_v2_20_1_tag, {});
 is($res, undef, 'no error on a tag not in our repo');
 
-deliver_patch('t/solve/0002-rename-with-modifications.patch');
+$deliver_patch->('t/solve/0002-rename-with-modifications.patch');
 $solver = PublicInbox::SolverGit->new($ibx, sub { $res = $_[0] });
 $solver->solve($psgi_env, $log, '0a92431', {});
 ok($res, 'resolved without hints');