/* Copyright (c) 2009-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "istream.h"
#include "imap-parser.h"
#include "test-common.h"
static void test_imap_parser_crlf(void)
{
unsigned int i;
test_begin("imap parser crlf handling");
/* must return -2 until LF is read */
for (i = 0; test_input[i] != '\n'; i++) {
(void)i_stream_read(input);
}
(void)i_stream_read(input);
/* CR without LF should fail with error */
i_stream_seek(input, ++i);
test_istream_set_size(input, ++i);
(void)i_stream_read(input);
test_istream_set_size(input, ++i);
(void)i_stream_read(input);
test_istream_set_size(input, ++i);
(void)i_stream_read(input);
test_end();
}
int main(void)
{
static void (*const test_functions[])(void) = {
};
return test_run(test_functions);
}