bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2009-2018 Dovecot authors, see the included COPYING file */
6d7c5ee9298444135f6051f810e6dcc467a2a968Timo Sirainen static const char *test_input = "foo\r\nx\ry\n";
6d7c5ee9298444135f6051f810e6dcc467a2a968Timo Sirainen unsigned int i;
6d7c5ee9298444135f6051f810e6dcc467a2a968Timo Sirainen parser = imap_parser_create(input, NULL, 1024);
6d7c5ee9298444135f6051f810e6dcc467a2a968Timo Sirainen /* must return -2 until LF is read */
6d7c5ee9298444135f6051f810e6dcc467a2a968Timo Sirainen test_assert(imap_parser_read_args(parser, 0, 0, &args) == -2);
32cec611ae362c98e3a22373fa1d2ded48621b57Timo Sirainen test_assert(imap_parser_read_args(parser, 0, 0, &args) == 1);
6d7c5ee9298444135f6051f810e6dcc467a2a968Timo Sirainen /* CR without LF should fail with error */
6d7c5ee9298444135f6051f810e6dcc467a2a968Timo Sirainen test_assert(imap_parser_read_args(parser, 0, 0, &args) == -2);
6d7c5ee9298444135f6051f810e6dcc467a2a968Timo Sirainen test_assert(imap_parser_read_args(parser, 0, 0, &args) == -2);
6d7c5ee9298444135f6051f810e6dcc467a2a968Timo Sirainen test_assert(imap_parser_read_args(parser, 0, 0, &args) == -1);
0adc24c0c534944b55a185795e09dfaea2ca3131Stephan Bosch (parser, &parse_error), "CR sent without LF") == 0 &&
baf3e87e186453fda13bd21f7cbcb2efc8492e8bTimo Sirainen static void (*const test_functions[])(void) = {