X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fpsgi_v2.t;h=6b1b3a39bd7f29f5656482aae6ed30dc9cb8b592;hb=169cb094abc6477cc38cc0eb0e2467a088e4068a;hp=64c1a8d38a0a5b842568657bde03d71175ec17a3;hpb=45f87867107724371d80a563099ab93eda1d919b;p=public-inbox.git diff --git a/t/psgi_v2.t b/t/psgi_v2.t index 64c1a8d3..6b1b3a39 100644 --- a/t/psgi_v2.t +++ b/t/psgi_v2.t @@ -1,5 +1,5 @@ #!perl -w -# Copyright (C) 2018-2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ use strict; use v5.10.1; @@ -20,11 +20,12 @@ To: test@example.com Subject: this is a subject Message-ID: Date: Fri, 02 Oct 1993 00:00:00 +0000 +Content-Type: text/plain; charset=iso-8859-1 hello world EOF my $new_mid; -my $ibx = create_inbox 'v2', version => 2, indexlevel => 'medium', +my $ibx = create_inbox 'v2-1', version => 2, indexlevel => 'medium', tmpdir => "$tmpdir/v2", sub { my ($im, $ibx) = @_; $im->add($eml) or BAIL_OUT; @@ -68,6 +69,8 @@ my $client0 = sub { like($res->content, qr!\$INBOX_DIR/description missing!, 'got v2 description missing message'); $res = $cb->(GET('/v2test/a-mid@b/raw')); + is($res->header('Content-Type'), 'text/plain; charset=iso-8859-1', + 'charset from message used'); $raw = $res->content; unlike($raw, qr/^From oldbug/sm, 'buggy "From_" line omitted'); like($raw, qr/^hello world$/m, 'got first message'); @@ -206,6 +209,8 @@ my $client1 = sub { local $SIG{__WARN__} = 'DEFAULT'; $res = $cb->(GET('/v2test/a-mid@b/')); $raw = $res->content; + like($raw, qr/WARNING: multiple messages have this Message-ID/, + 'warned about duplicate Message-IDs'); like($raw, qr/^hello world$/m, 'got first message'); like($raw, qr/^hello world!$/m, 'got second message'); like($raw, qr/^hello ghosts$/m, 'got third message');