File: 401msg-replsubj.t

package info (click to toggle)
libmail-message-perl 3.017-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,632 kB
  • sloc: perl: 11,156; makefile: 4
file content (37 lines) | stat: -rw-r--r-- 1,651 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env perl
#
# Test the creation of reply subjects
#

use strict;
use warnings;

use Mail::Message::Test;
use Mail::Message::Construct::Reply;

use Test::More tests => 21;


is(Mail::Message->replySubject('subject'), 'Re: subject');
is(Mail::Message->replySubject('Re: subject'), 'Re[2]: subject');
is(Mail::Message->replySubject('Re[1]: subject'), 'Re[2]: subject');
is(Mail::Message->replySubject('Re[2]: subject'), 'Re[3]: subject');
is(Mail::Message->replySubject('Re: Re: subject'), 'Re[3]: subject');
is(Mail::Message->replySubject('Re: Re[2]: subject'), 'Re[4]: subject');
is(Mail::Message->replySubject('Re Re: subject'), 'Re[3]: subject');
is(Mail::Message->replySubject('Re,Re: subject'), 'Re[3]: subject');
is(Mail::Message->replySubject('Re Re[2]: subject'), 'Re[4]: subject');
is(Mail::Message->replySubject('subject (Re)'), 'Re[2]: subject');
is(Mail::Message->replySubject('subject (Re) (Re)'), 'Re[3]: subject');
is(Mail::Message->replySubject('Re: subject (Re)'), 'Re[3]: subject');
is(Mail::Message->replySubject('subject (Forw)'), 'Re[2]: subject');
is(Mail::Message->replySubject('subject (Re) (Forw)'), 'Re[3]: subject');
is(Mail::Message->replySubject('Re: subject (Forw)'), 'Re[3]: subject');

is(Mail::Message->replySubject('subject: sub2'), 'Re: subject: sub2');
is(Mail::Message->replySubject('Re: subject: sub2'), 'Re[2]: subject: sub2');
is(Mail::Message->replySubject('subject : sub2'), 'Re: subject : sub2');
ok(Mail::Message->replySubject('Re: subject : sub2 (Forw)')
   eq 'Re[3]: subject : sub2');
is(Mail::Message->replySubject(''), 'Re: your mail');
is(Mail::Message->replySubject(undef), 'Re: your mail');