diff --git a/cassandane/Cassandane/Cyrus/QResync.pm b/cassandane/Cassandane/Cyrus/QResync.pm index b87465dfb1..813d11c170 100644 --- a/cassandane/Cassandane/Cyrus/QResync.pm +++ b/cassandane/Cassandane/Cyrus/QResync.pm @@ -104,4 +104,36 @@ sub test_qresync_simple $self->assert_equals("5:10,25:45", $vanished[0][1]); } +sub test_qresync_saved_search +{ + my ($self) = @_; + + xlog $self, "Make some messages"; + my $uid = 1; + my %msgs; + for (1..3) + { + $msgs{$uid} = $self->make_message("Message $uid"); + $msgs{$uid}->set_attribute('uid', $uid); + $uid++; + } + + my $talk = $self->{store}->get_client(); + $talk->uid(1); + $talk->enable("qresync"); + $talk->select("INBOX"); + my $since = $talk->get_response_code('highestmodseq'); + for (4..6) + { + $msgs{$uid} = $self->make_message("Message $uid"); + $msgs{$uid}->set_attribute('uid', $uid); + $uid++; + } + $talk->store('5', '+flags', '(\\Deleted)'); + $talk->expunge(); + $talk->search('RETURN', ['SAVE'], 'SINCE', '1-Feb-1994'); + my $res = $talk->fetch('$', ['FLAGS'], ['CHANGEDSINCE', $since, 'VANISHED']); + $self->assert_str_equals("4,6", join(',', sort keys %$res)); +} + 1;