#!perl
use Cassandane::Tiny;

sub test_mbpath_8bit ($self)
{
    xlog $self, "Test mbpath 8 bit name parsing";

    # create and prepare the user
    my $imaptalk = $self->{store}->get_client();
    $imaptalk->create('A & B');

    xlog "check with 8bit name";
    my $mbpath = $self->{instance}->run_mbpath('user.cassandane.A & B');
    $self->assert_str_equals($mbpath->{mbname}{intname}, 'user.cassandane.A &- B');

    xlog "check with 7bit name";
    $mbpath = $self->{instance}->run_mbpath("-7", 'user.cassandane.A &- B');
    $self->assert_str_equals($mbpath->{mbname}{intname}, 'user.cassandane.A &- B');
}
