X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/86be0c3098d8e27807bc618126b8babfe7f93928..bb6ae3fb80fff36cd342d6f6bff3dfabd7dd243e:/lib/test.c diff --git a/lib/test.c b/lib/test.c index 61b63fd..27651ec 100644 --- a/lib/test.c +++ b/lib/test.c @@ -454,6 +454,16 @@ static void test_mime(void) { check_string(mime_qp("x =\r\ny"), "x y"); check_string(mime_qp("x = \r\ny"), "x y"); + check_string(mime_to_qp(""), ""); + check_string(mime_to_qp("foobar\n"), "foobar\n"); + check_string(mime_to_qp("foobar \n"), "foobar=20\n"); + check_string(mime_to_qp("foobar\t\n"), "foobar=09\n"); + check_string(mime_to_qp("foobar \t \n"), "foobar=20=09=20\n"); + check_string(mime_to_qp(" foo=bar"), " foo=3Dbar\n"); + check_string(mime_to_qp("copyright \xC2\xA9"), "copyright =C2=A9\n"); + check_string(mime_to_qp("foo\nbar\nbaz\n"), "foo\nbar\nbaz\n"); + check_string(mime_to_qp("wibble wobble wibble wobble wibble wobble wibble wobble wibble wobble wibble"), "wibble wobble wibble wobble wibble wobble wibble wobble wibble wobble wibb=\nle\n"); + /* from RFC2045 */ check_string(mime_qp("Now's the time =\r\n" "for all folk to come=\r\n"