X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fsolver_git.t;h=7f0cd999344dc52da63d00c86a4b1d2d27a48c46;hb=0f6b0cac5bf10d036a84dbab732e8991edf56c34;hp=92402c3a16768b88aea7347254cfcb9f2a78952f;hpb=c5c709dcef1b5904467ff2aea3943f00a891dade;p=public-inbox.git diff --git a/t/solver_git.t b/t/solver_git.t index 92402c3a..7f0cd999 100644 --- a/t/solver_git.t +++ b/t/solver_git.t @@ -1,4 +1,4 @@ -# Copyright (C) 2019 all contributors +# Copyright (C) 2019-2020 all contributors # License: AGPL-3.0+ use strict; use warnings; @@ -28,8 +28,8 @@ my $im = PublicInbox::V2Writable->new($ibx, 1); $im->{parallel} = 0; my $deliver_patch = sub ($) { - open my $fh, '<', $_[0] or die "open: $!"; - my $mime = PublicInbox::MIME->new(do { local $/; <$fh> }); + my $mime = PublicInbox::InboxWritable::mime_from_path($_[0]) or + die "open $_[0]: $!"; $im->add($mime); $im->done; }; @@ -154,7 +154,16 @@ EOF my $non_existent = 'ee5e32211bf62ab6531bdf39b84b6920d0b6775a'; my $client = sub { my ($cb) = @_; - my $res = $cb->(GET("/$name/3435775/s/")); + my $mid = '20190401081523.16213-1-BOFH@YHBT.net'; + my @warn; + my $res = do { + local $SIG{__WARN__} = sub { push @warn, @_ }; + $cb->(GET("/$name/$mid/")); + }; + is_deeply(\@warn, [], 'no warnings from rendering diff'); + like($res->content, qr!>Ω!, 'omega escaped'); + + $res = $cb->(GET("/$name/3435775/s/")); is($res->code, 200, 'success with existing blob'); $res = $cb->(GET("/$name/".('0'x40).'/s/'));