about summary refs log tree commit homepage
path: root/xt
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-10-09 17:56:23 +0000
committerEric Wong <e@80x24.org>2023-10-09 18:41:36 +0000
commit5754faeb3fa1c9aaeff8922b449127cfbc86236d (patch)
tree09381346561d119ef30d6465baacc44f8a9d32dd /xt
parent02cd38ea042e01f343d52f8401cd56cf8e37dd9d (diff)
downloadpublic-inbox-5754faeb3fa1c9aaeff8922b449127cfbc86236d.tar.gz
We can't assume git output is UTF-8, and we'll always have
legacy data in git coderepos.  So attempt to display some
some garbled text rather than nothing at all if Perl croaks
on it.

sox commit c38987e8d20505621b8d872863afa7d233ed1096
(Added raw inverse-bit u-law and A-law support.  Updated *.txt files., 2001-12-13)
is an example of a commit which caused problems for me.
Diffstat (limited to 'xt')
-rw-r--r--xt/solver.t31
1 files changed, 18 insertions, 13 deletions
diff --git a/xt/solver.t b/xt/solver.t
index 06f5a493..51b4144c 100644
--- a/xt/solver.t
+++ b/xt/solver.t
@@ -32,23 +32,30 @@ my $todo = {
                 'c2f3bf071ee90b01f2d629921bb04c4f798f02fa/s/', # tag
                 '7eb93c89651c47c8095d476251f2e4314656b292/s/', # non-UTF-8
         ],
+        'sox-devel' => [
+                'c38987e8d20505621b8d872863afa7d233ed1096/s/', # non-UTF-8
+        ]
 };
 
-my ($ibx_name, $urls, @gone);
+my @gone;
 my $client = sub {
         my ($cb) = @_;
-        for my $u (@$urls) {
-                my $url = "/$ibx_name/$u";
-                my $res = $cb->(GET($url));
-                is($res->code, 200, $url);
-                next if $res->code == 200;
-                diag "$url failed";
-                diag $res->content;
+        for my $ibx_name (sort keys %$todo) {
+                diag "testing $ibx_name";
+                my $urls = $todo->{$ibx_name};
+                for my $u (@$urls) {
+                        my $url = "/$ibx_name/$u";
+                        my $res = $cb->(GET($url));
+                        is($res->code, 200, $url);
+                        next if $res->code == 200;
+                        diag "$url failed";
+                        diag $res->content;
+                }
         }
 };
 
 my $nr = 0;
-while (($ibx_name, $urls) = each %$todo) {
+while (my ($ibx_name, $urls) = each %$todo) {
         SKIP: {
                 my $ibx = $cfg->lookup_name($ibx_name);
                 if (!$ibx) {
@@ -61,15 +68,13 @@ while (($ibx_name, $urls) = each %$todo) {
                         skip(qq{publicinbox.$ibx_name.coderepo not configured},
                                 scalar(@$urls));
                 }
-                test_psgi($app, $client);
                 $nr++;
         }
 }
 
 delete @$todo{@gone};
+test_psgi($app, $client);
 my $env = { PI_CONFIG => PublicInbox::Config->default_file };
-while (($ibx_name, $urls) = each %$todo) {
-        test_httpd($env, $client, $nr);
-}
+test_httpd($env, $client, $nr);
 
 done_testing();