diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-03-27 13:00:43 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-03-27 13:00:43 +0200 |
commit | dc0e689310121619eff2c28432997d85069d2565 (patch) | |
tree | 9ad25af0c3797c553470f1200d144afdc003e04a /libmailutils/tests | |
parent | 9f7eb0a63d0c8e406636c9ad9f0d12aeb5ca077c (diff) | |
download | mailutils-dc0e689310121619eff2c28432997d85069d2565.tar.gz mailutils-dc0e689310121619eff2c28432997d85069d2565.tar.bz2 |
Minor fixes in dot filters.
The DOT decoder accepts input consisting of two characters ".\n"
and decodes it to empty output. When encoding empty input, ".\n"
is produced
Similarly, CRLFDOT handles ".\r\n" the same way.
* libmailutils/filter/crlfdot.c (_crlfdot_encoder): Accept ".\r\n"
as input.
* libmailutils/filter/dot.c: Accept ".\n" as input.
* libmailutils/tests/crlfdot.at: Add new test.
* libmailutils/tests/dot.at: Likewise.
Diffstat (limited to 'libmailutils/tests')
-rw-r--r-- | libmailutils/tests/crlfdot.at | 9 | ||||
-rw-r--r-- | libmailutils/tests/dot.at | 13 |
2 files changed, 21 insertions, 1 deletions
diff --git a/libmailutils/tests/crlfdot.at b/libmailutils/tests/crlfdot.at index 3c7cf8802..8d12955c3 100644 --- a/libmailutils/tests/crlfdot.at +++ b/libmailutils/tests/crlfdot.at @@ -99,4 +99,11 @@ three four . EOT -])
\ No newline at end of file +]) + +MU_FILTER_TEST([decode single line],[crlfdot],[decode],[],[-gen], +[], +[tocrlf <<EOT +. +EOT +]) diff --git a/libmailutils/tests/dot.at b/libmailutils/tests/dot.at index 7be7bb6b2..dd528abb9 100644 --- a/libmailutils/tests/dot.at +++ b/libmailutils/tests/dot.at @@ -56,6 +56,19 @@ AT_CHECK([fltst dot encode read < /dev/null], ]) AT_CLEANUP +AT_SETUP([DOT decode single line input]) +AT_KEYWORDS([DOT one-line]) +AT_CHECK( +[AT_DATA([input],[ +. +]) +fltst dot decode read < input +], +[0], +[ +]) +AT_CLEANUP + AT_SETUP([DOT reversibility]) AT_KEYWORDS([filter dot]) AT_CHECK([ |