Skip to content

Commit f27fa5a

Browse files
committed
QResync: add a test that saved fetch returns correctly
1 parent 23c3f7e commit f27fa5a

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

cassandane/Cassandane/Cyrus/QResync.pm

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,36 @@ sub test_qresync_simple
104104
$self->assert_equals("5:10,25:45", $vanished[0][1]);
105105
}
106106

107+
sub test_qresync_saved_search
108+
{
109+
my ($self) = @_;
110+
111+
xlog $self, "Make some messages";
112+
my $uid = 1;
113+
my %msgs;
114+
for (1..3)
115+
{
116+
$msgs{$uid} = $self->make_message("Message $uid");
117+
$msgs{$uid}->set_attribute('uid', $uid);
118+
$uid++;
119+
}
120+
121+
my $talk = $self->{store}->get_client();
122+
$talk->uid(1);
123+
$talk->enable("qresync");
124+
$talk->select("INBOX");
125+
my $since = $talk->get_response_code('highestmodseq');
126+
for (4..6)
127+
{
128+
$msgs{$uid} = $self->make_message("Message $uid");
129+
$msgs{$uid}->set_attribute('uid', $uid);
130+
$uid++;
131+
}
132+
$talk->store('5', '+flags', '(\\Deleted)');
133+
$talk->expunge();
134+
$talk->search('RETURN', ['SAVE'], 'SINCE', '1-Feb-1994');
135+
my $res = $talk->fetch('$', ['FLAGS'], ['CHANGEDSINCE', $since, 'VANISHED']);
136+
$self->assert_str_equals("4,6", join(',', sort keys %$res));
137+
}
138+
107139
1;

0 commit comments

Comments
 (0)