mirror of
https://github.com/imapsync/imapsync.git
synced 2025-06-11 07:04:36 +02:00
1.404
This commit is contained in:
parent
d88bf4b46a
commit
02322d6ed1
73 changed files with 19532 additions and 23747 deletions
37
Mail-IMAPClient-3.27/t/messageset.t
Normal file
37
Mail-IMAPClient-3.27/t/messageset.t
Normal file
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 7;
|
||||
|
||||
BEGIN { use_ok('Mail::IMAPClient::MessageSet') or exit; }
|
||||
|
||||
my $one = q/1:4,3:6,10:15,20:25,2:8/;
|
||||
my $range = Mail::IMAPClient::MessageSet->new($one);
|
||||
is( $range, "1:8,10:15,20:25", 'range simplify' );
|
||||
|
||||
is(
|
||||
join( ",", $range->unfold ),
|
||||
"1,2,3,4,5,6,7,8,10,11,12,13,14,15,20,21,22,23,24,25",
|
||||
'range unfold'
|
||||
);
|
||||
|
||||
$range .= "30,31,32,31:34,40:44";
|
||||
is( $range, "1:8,10:15,20:25,30:34,40:44", 'overload concat' );
|
||||
|
||||
is(
|
||||
join( ",", $range->unfold ),
|
||||
"1,2,3,4,5,6,7,8,10,11,12,13,14,15,20,21,22,23,24,25,"
|
||||
. "30,31,32,33,34,40,41,42,43,44",
|
||||
'unfold extended'
|
||||
);
|
||||
|
||||
$range -= "1:2";
|
||||
is( $range, "3:8,10:15,20:25,30:34,40:44", 'overload subtract' );
|
||||
|
||||
is(
|
||||
join( ",", $range->unfold ),
|
||||
"3,4,5,6,7,8,10,11,12,13,14,15,20,21,22,23,24,25,"
|
||||
. "30,31,32,33,34,40,41,42,43,44",
|
||||
'subtract unfold'
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue