about summary refs log tree commit
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-01-10 08:49:31 +0000
committerEric Wong <e@yhbt.net>2020-01-11 21:16:26 +0000
commit62f28026e624ed30d620063a0fa92cbedb7f6673 (patch)
tree8cdd2a4646c3304e5a6072e824fe5da2aa05eea8 /t
parentf018d5cc70f3a6983e4ec188ae62a729a8b31157 (diff)
downloadpublic-inbox-62f28026e624ed30d620063a0fa92cbedb7f6673.tar.gz
Some users just want to run -mda, -watch, and/or -nntpd.
Let them run just those without forcing them to pull in a
bunch of dependencies.
Diffstat (limited to 't')
-rw-r--r--t/cgi.t1
-rw-r--r--t/httpd-https.t2
-rw-r--r--t/psgi_attach.t6
-rw-r--r--t/psgi_bad_mids.t4
-rw-r--r--t/psgi_mount.t17
-rw-r--r--t/psgi_multipart_not.t2
-rw-r--r--t/psgi_search.t2
-rw-r--r--t/psgi_text.t5
-rw-r--r--t/psgi_v2.t2
-rw-r--r--t/solver_git.t2
-rw-r--r--t/view.t3
11 files changed, 22 insertions, 24 deletions
diff --git a/t/cgi.t b/t/cgi.t
index 9f67d5c0..5760596c 100644
--- a/t/cgi.t
+++ b/t/cgi.t
@@ -7,6 +7,7 @@ use warnings;
 use Test::More;
 use Email::MIME;
 use PublicInbox::TestCommon;
+require_mods(qw(Plack::Handler::CGI Plack::Util));
 my ($tmpdir, $for_destroy) = tmpdir();
 my $home = "$tmpdir/pi-home";
 my $pi_home = "$home/.public-inbox";
diff --git a/t/httpd-https.t b/t/httpd-https.t
index 265febe5..9ce060c8 100644
--- a/t/httpd-https.t
+++ b/t/httpd-https.t
@@ -6,7 +6,7 @@ use Test::More;
 use Socket qw(SOCK_STREAM IPPROTO_TCP SOL_SOCKET);
 use PublicInbox::TestCommon;
 # IO::Poll is part of the standard library, but distros may split them off...
-require_mods(qw(IO::Socket::SSL IO::Poll));
+require_mods(qw(IO::Socket::SSL IO::Poll Plack::Util));
 my $cert = 'certs/server-cert.pem';
 my $key = 'certs/server-key.pem';
 unless (-r $key && -r $cert) {
diff --git a/t/psgi_attach.t b/t/psgi_attach.t
index 0c3174bc..1ef5318c 100644
--- a/t/psgi_attach.t
+++ b/t/psgi_attach.t
@@ -9,15 +9,14 @@ my ($tmpdir, $for_destroy) = tmpdir();
 my $maindir = "$tmpdir/main.git";
 my $addr = 'test-public@example.com';
 my $cfgpfx = "publicinbox.test";
-my @mods = qw(HTTP::Request::Common Plack::Test URI::Escape);
+my @mods = qw(HTTP::Request::Common Plack::Builder Plack::Test URI::Escape);
 require_mods(@mods);
 use_ok $_ foreach @mods;
+use_ok 'PublicInbox::WWW';
 use PublicInbox::Import;
 use PublicInbox::Git;
 use PublicInbox::Config;
-use PublicInbox::WWW;
 use_ok 'PublicInbox::WwwAttach';
-use Plack::Builder;
 my $config = PublicInbox::Config->new(\<<EOF);
 $cfgpfx.address=$addr
 $cfgpfx.inboxdir=$maindir
@@ -108,7 +107,6 @@ my $im = PublicInbox::Import->new($git, 'test', $addr);
                 ok(length($dot_res) >= length($dot), 'dot almost matches');
                 $res = $cb->(GET('/test/Z%40B/4-any-filename.txt'));
                 is($res->content, $dot_res, 'user-specified filename is OK');
-
         });
 }
 done_testing();
diff --git a/t/psgi_bad_mids.t b/t/psgi_bad_mids.t
index 5cdd249e..b568786d 100644
--- a/t/psgi_bad_mids.t
+++ b/t/psgi_bad_mids.t
@@ -5,12 +5,12 @@ use warnings;
 use Test::More;
 use PublicInbox::MIME;
 use PublicInbox::Config;
-use PublicInbox::WWW;
 use PublicInbox::TestCommon;
 my @mods = qw(DBD::SQLite HTTP::Request::Common Plack::Test
-                URI::Escape Plack::Builder);
+                URI::Escape Plack::Builder PublicInbox::WWW);
 require_mods(@mods);
 use_ok($_) for @mods;
+use_ok 'PublicInbox::WWW';
 use_ok 'PublicInbox::V2Writable';
 my ($inboxdir, $for_destroy) = tmpdir();
 my $cfgpfx = "publicinbox.bad-mids";
diff --git a/t/psgi_mount.t b/t/psgi_mount.t
index 751c13b7..d29df054 100644
--- a/t/psgi_mount.t
+++ b/t/psgi_mount.t
@@ -9,15 +9,14 @@ my ($tmpdir, $for_destroy) = tmpdir();
 my $maindir = "$tmpdir/main.git";
 my $addr = 'test-public@example.com';
 my $cfgpfx = "publicinbox.test";
-my @mods = qw(HTTP::Request::Common Plack::Test URI::Escape);
+my @mods = qw(HTTP::Request::Common Plack::Test URI::Escape
+        Plack::Builder Plack::App::URLMap);
 require_mods(@mods);
 use_ok $_ foreach @mods;
+use_ok 'PublicInbox::WWW';
 use PublicInbox::Import;
 use PublicInbox::Git;
 use PublicInbox::Config;
-use PublicInbox::WWW;
-use Plack::Builder;
-use Plack::App::URLMap;
 my $config = PublicInbox::Config->new(\<<EOF);
 $cfgpfx.address=$addr
 $cfgpfx.inboxdir=$maindir
@@ -41,11 +40,11 @@ EOF
 }
 
 my $www = PublicInbox::WWW->new($config);
-my $app = builder {
-        enable 'Head';
-        mount '/a' => builder { sub { $www->call(@_) } };
-        mount '/b' => builder { sub { $www->call(@_) } };
-};
+my $app = builder(sub {
+        enable('Head');
+        mount('/a' => builder(sub { sub { $www->call(@_) } }));
+        mount('/b' => builder(sub { sub { $www->call(@_) } }));
+});
 
 test_psgi($app, sub {
         my ($cb) = @_;
diff --git a/t/psgi_multipart_not.t b/t/psgi_multipart_not.t
index 606151c4..47a691f6 100644
--- a/t/psgi_multipart_not.t
+++ b/t/psgi_multipart_not.t
@@ -5,12 +5,12 @@ use warnings;
 use Test::More;
 use Email::MIME;
 use PublicInbox::Config;
-use PublicInbox::WWW;
 use PublicInbox::TestCommon;
 my @mods = qw(DBD::SQLite Search::Xapian HTTP::Request::Common
               Plack::Test URI::Escape Plack::Builder Plack::Test);
 require_mods(@mods);
 use_ok($_) for (qw(HTTP::Request::Common Plack::Test));
+use_ok 'PublicInbox::WWW';
 use_ok 'PublicInbox::V2Writable';
 my ($repo, $for_destroy) = tmpdir();
 my $ibx = PublicInbox::Inbox->new({
diff --git a/t/psgi_search.t b/t/psgi_search.t
index 534063f8..5310e5ab 100644
--- a/t/psgi_search.t
+++ b/t/psgi_search.t
@@ -7,13 +7,13 @@ use Email::MIME;
 use PublicInbox::Config;
 use PublicInbox::Inbox;
 use PublicInbox::InboxWritable;
-use PublicInbox::WWW;
 use bytes (); # only for bytes::length
 use PublicInbox::TestCommon;
 my @mods = qw(DBD::SQLite Search::Xapian HTTP::Request::Common Plack::Test
                 URI::Escape Plack::Builder);
 require_mods(@mods);
 use_ok($_) for (qw(HTTP::Request::Common Plack::Test));
+use_ok 'PublicInbox::WWW';
 my ($tmpdir, $for_destroy) = tmpdir();
 
 my $ibx = PublicInbox::Inbox->new({
diff --git a/t/psgi_text.t b/t/psgi_text.t
index 757a1294..7cb7a165 100644
--- a/t/psgi_text.t
+++ b/t/psgi_text.t
@@ -9,15 +9,14 @@ my ($tmpdir, $for_destroy) = tmpdir();
 my $maindir = "$tmpdir/main.git";
 my $addr = 'test-public@example.com';
 my $cfgpfx = "publicinbox.test";
-my @mods = qw(HTTP::Request::Common Plack::Test URI::Escape);
+my @mods = qw(HTTP::Request::Common Plack::Test URI::Escape Plack::Builder);
 require_mods(@mods);
 use_ok $_ foreach @mods;
 use PublicInbox::Import;
 use PublicInbox::Git;
 use PublicInbox::Config;
-use PublicInbox::WWW;
+use_ok 'PublicInbox::WWW';
 use_ok 'PublicInbox::WwwText';
-use Plack::Builder;
 my $config = PublicInbox::Config->new(\<<EOF);
 $cfgpfx.address=$addr
 $cfgpfx.inboxdir=$maindir
diff --git a/t/psgi_v2.t b/t/psgi_v2.t
index 8c619cee..2ecd7458 100644
--- a/t/psgi_v2.t
+++ b/t/psgi_v2.t
@@ -7,11 +7,11 @@ use PublicInbox::TestCommon;
 require_git(2.6);
 use PublicInbox::MIME;
 use PublicInbox::Config;
-use PublicInbox::WWW;
 use PublicInbox::MID qw(mids);
 require_mods(qw(DBD::SQLite Search::Xapian HTTP::Request::Common Plack::Test
                 URI::Escape Plack::Builder));
 use_ok($_) for (qw(HTTP::Request::Common Plack::Test));
+use_ok 'PublicInbox::WWW';
 use_ok 'PublicInbox::V2Writable';
 my ($inboxdir, $for_destroy) = tmpdir();
 my $ibx = {
diff --git a/t/solver_git.t b/t/solver_git.t
index 67ae02e6..77fa1e09 100644
--- a/t/solver_git.t
+++ b/t/solver_git.t
@@ -7,7 +7,7 @@ use Cwd qw(abs_path);
 use PublicInbox::TestCommon;
 require_git(2.6);
 use PublicInbox::Spawn qw(spawn);
-require_mods(qw(DBD::SQLite Search::Xapian));
+require_mods(qw(DBD::SQLite Search::Xapian Plack::Util));
 chomp(my $git_dir = `git rev-parse --git-dir 2>/dev/null`);
 plan skip_all => "$0 must be run from a git working tree" if $?;
 
diff --git a/t/view.t b/t/view.t
index 92962b15..38c12fcc 100644
--- a/t/view.t
+++ b/t/view.t
@@ -3,8 +3,9 @@
 use strict;
 use warnings;
 use Test::More;
+use PublicInbox::TestCommon;
 use Email::MIME;
-use Plack::Util;
+require_mods('Plack::Util');
 use_ok 'PublicInbox::View';
 use_ok 'PublicInbox::Config';