#!perl
use Cassandane::Tiny;

sub test_misc_upload_pagesize_ending_dash
{
    my ($self) = @_;
    my $jmap = $self->{jmap};

    # We need a page-size email (4096 bytes)
    my $email = "Header: Value\r\n\r\n";
    $email .=  ("X" x (4096 - length($email) - 3)) . "\r\n\-";

    my $data = $jmap->Upload($email, "message/rfc822");
    $self->assert_not_null($data);
    $self->assert_num_equals(4096, $data->{size});
    $self->assert_str_equals("message/rfc822", $data->{type});
}
