Skip to content

Commit

Permalink
QResync: add a test that saved fetch returns correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
brong committed Jan 3, 2025
1 parent 23c3f7e commit f27fa5a
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions cassandane/Cassandane/Cyrus/QResync.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit f27fa5a

Please sign in to comment.