diff options
-rw-r--r-- | tests/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tests/test_quote_html.cc | 44 |
2 files changed, 46 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 59b7d99..106025c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -52,3 +52,5 @@ add_astroid_test (address test_address test_address.cc add_astroid_test (dates test_dates test_dates.cc ) add_astroid_test (crypto test_crypto test_crypto.cc ) add_astroid_test (gmime_version test_gmime_version test_gmime_version.cc ) +add_astroid_test (quote_html test_quote_html test_quote_html.cc ) + diff --git a/tests/test_quote_html.cc b/tests/test_quote_html.cc new file mode 100644 index 0000000..b3f7616 --- /dev/null +++ b/tests/test_quote_html.cc @@ -0,0 +1,44 @@ +# define BOOST_TEST_DYN_LINK +# define BOOST_TEST_MODULE TestCompose +# include <boost/test/unit_test.hpp> + +# include "test_common.hh" +# include "message_thread.hh" +# include "utils/ustring_utils.hh" + +BOOST_AUTO_TEST_SUITE(QuoteHtml) + + BOOST_AUTO_TEST_CASE(quote_html_lynx) + { + using Astroid::Message; + setup (); + + ustring fname = "tests/mail/test_mail/only-html.eml"; + + Message m (fname); + ustring quoted = m.quote (); + + LOG (trace) << "quoted plain text: " << quoted; + + Astroid::UstringUtils::trim (quoted); + + ustring target = R"(1. save an email as file.eml + 2. write a new email + 3. attach file.eml + 4. save as draft + 5. quit astroid + 6. open draft again + 7. edit the draft + 8. here it is. + +— +You are receiving this because you commented. +Reply to this email directly, view it on GitHub, or mute the thread.*)"; + + BOOST_CHECK (quoted == target); + + teardown (); + } + +BOOST_AUTO_TEST_SUITE_END() + |