| 1 |
#!/usr/bin/perl |
| 2 |
# |
| 3 |
# Copyright (c) 2017 FastMail Pty Ltd All rights reserved. |
| 4 |
# |
| 5 |
# Redistribution and use in source and binary forms, with or without |
| 6 |
# modification, are permitted provided that the following conditions |
| 7 |
# are met: |
| 8 |
# |
| 9 |
# 1. Redistributions of source code must retain the above copyright |
| 10 |
# notice, this list of conditions and the following disclaimer. |
| 11 |
# |
| 12 |
# 2. Redistributions in binary form must reproduce the above copyright |
| 13 |
# notice, this list of conditions and the following disclaimer in |
| 14 |
# the documentation and/or other materials provided with the |
| 15 |
# distribution. |
| 16 |
# |
| 17 |
# 3. The name "Fastmail Pty Ltd" must not be used to |
| 18 |
# endorse or promote products derived from this software without |
| 19 |
# prior written permission. For permission or any legal |
| 20 |
# details, please contact |
| 21 |
# FastMail Pty Ltd |
| 22 |
# PO Box 234 |
| 23 |
# Collins St West 8007 |
| 24 |
# Victoria |
| 25 |
# Australia |
| 26 |
# |
| 27 |
# 4. Redistributions of any form whatsoever must retain the following |
| 28 |
# acknowledgment: |
| 29 |
# "This product includes software developed by Fastmail Pty. Ltd." |
| 30 |
# |
| 31 |
# FASTMAIL PTY LTD DISCLAIMS ALL WARRANTIES WITH REGARD TO |
| 32 |
# THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY |
| 33 |
# AND FITNESS, IN NO EVENT SHALL OPERA SOFTWARE AUSTRALIA BE LIABLE |
| 34 |
# FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 35 |
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN |
| 36 |
# AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING |
| 37 |
# OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 38 |
# |
| 39 |
|
| 40 |
package Cassandane::Cyrus::Bug3072; |
| 41 |
use strict; |
| 42 |
use warnings; |
| 43 |
use DateTime; |
| 44 |
|
| 45 |
use lib '.'; |
| 46 |
use base qw(Cassandane::Cyrus::TestCase); |
| 47 |
use Cassandane::Util::Log; |
| 48 |
|
| 49 |
sub new |
| 50 |
{ |
| 51 |
my $class = shift; |
| 52 |
return $class->SUPER::new({}, @_); |
| 53 |
} |
| 54 |
|
| 55 |
sub set_up |
| 56 |
{ |
| 57 |
my ($self) = @_; |
| 58 |
$self->SUPER::set_up(); |
| 59 |
} |
| 60 |
|
| 61 |
sub tear_down |
| 62 |
{ |
| 63 |
my ($self) = @_; |
| 64 |
$self->SUPER::tear_down(); |
| 65 |
} |
| 66 |
|
| 67 |
# |
| 68 |
# Test COPY behaviour with a very long sequence set |
| 69 |
# |
| 70 |
sub test_copy_longset_slow |
| 71 |
{ |
| 72 |
my ($self) = @_; |
| 73 |
|
| 74 |
my $imaptalk = $self->{store}->get_client(); |
| 75 |
|
| 76 |
$imaptalk->create("INBOX.dest"); |
| 77 |
for (1..2000) { |
| 78 |
$self->make_message("Message $_"); |
| 79 |
} |
| 80 |
my $list = join(',', map { $_ * 2 } 1..1000); |
| 81 |
|
| 82 |
$imaptalk->copy($list, "INBOX.dest"); |
| 83 |
|
| 84 |
# XXX this doesn't even verify that the messages were copied! |
| 85 |
} |
| 86 |
|
| 87 |
1; |