test-imap-quote.c revision d8ce48fb2b068ceae03f8df3610e254c3ccd2b2e
/* Copyright (c) 2013 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "str.h"
#include "imap-quote.h"
#include "test-common.h"
static void test_imap_append_string_for_humans(void)
{
static struct {
} tests[] = {
{ "", "\"\"" },
{ " ", "\"\"" },
{ " ", "\"\"" },
{ "\t", "\"\"" },
{ " \t", "\"\"" },
{ " \t ", "\"\"" },
{ " foo", "{3}\r\nfoo" },
{ "\tfoo", "{3}\r\nfoo" },
{ "\t \tfoo", "{3}\r\nfoo" },
{ " foo ", "{3}\r\nfoo" },
{ " foo ", "{3}\r\nfoo" },
{ " foo \t \t", "{3}\r\nfoo" }
};
unsigned int i;
test_begin("imap_append_string_for_humans()");
for (i = 0; i < N_ELEMENTS(tests); i++) {
str_truncate(str, 0);
}
test_end();
}
int main(void)
{
static void (*test_functions[])(void) = {
};
return test_run(test_functions);
}