#!perl
use Cassandane::Tiny;

sub test_intermediate_rename
    :AllowMoves :Replication :SyncLog :DelayedDelete :min_version_3_3
{
    my ($self) = @_;

    my $mtalk = $self->{master_store}->get_client();

    $mtalk->create('INBOX.a.b');

    # replicate and check initial state
    my $synclogfname = "$self->{instance}->{basedir}/conf/sync/log";
    $self->run_replication(rolling => 1, inputfile => $synclogfname);
    unlink($synclogfname);

    # reconnect
    $mtalk = $self->{master_store}->get_client();

    $mtalk->create('INBOX.a');
    $mtalk->rename('INBOX.a', 'INBOX.new');

    #$self->run_replication(rolling => 1, inputfile => $synclogfname);
    $self->run_replication();

    $self->check_replication('cassandane');
}
