summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGaute Hope <eg@gaute.vetsj.com>2019-04-07 14:30:04 +0200
committerGaute Hope <eg@gaute.vetsj.com>2019-04-07 14:30:04 +0200
commit23c360f79a69c6c228de0a2dc566d2df7e9fa30b (patch)
treeae51dab9ab4764a6d52369f68ab2a32465dd4702
parentbb6ffacd86046ba8c2cff51bf2688cb4e2043bd2 (diff)
quote html: add test
-rw-r--r--tests/CMakeLists.txt2
-rw-r--r--tests/test_quote_html.cc44
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()
+