#!perl
use Cassandane::Tiny;

#
# A FETCH (OBJECTID) that the frontend passes on to the backend activates
# OBJECTID+ on the frontend too, so a later ENABLE reports nothing new.
#
sub test_objectidplus_backend_activation
    ($self)
{
    my $frontend = $self->{frontend_store}->get_client();
    $self->make_message('one', store => $self->{frontend_store});
    $frontend->select('INBOX');

    my $enabled;
    my %handlers = (enabled => sub ($, $list) { $enabled = $list });
    $frontend->_imap_cmd('FETCH', 0, \%handlers, '1', '(OBJECTID)');
    $self->assert_str_equals('ok', $frontend->get_last_completion_response());
    $self->assert_cmp_deeply(['OBJECTID+'], $enabled);

    $enabled = undef;
    $frontend->_imap_cmd('ENABLE', 0, \%handlers, 'OBJECTID+');
    $self->assert_str_equals('ok', $frontend->get_last_completion_response());
    $self->assert_cmp_deeply([], $enabled // []);
}
