summaryrefslogtreecommitdiff
path: root/gentoobrowse-api/unittests/testProcessAll.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gentoobrowse-api/unittests/testProcessAll.cpp')
-rw-r--r--gentoobrowse-api/unittests/testProcessAll.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/gentoobrowse-api/unittests/testProcessAll.cpp b/gentoobrowse-api/unittests/testProcessAll.cpp
index cd72a8c..b06ad23 100644
--- a/gentoobrowse-api/unittests/testProcessAll.cpp
+++ b/gentoobrowse-api/unittests/testProcessAll.cpp
@@ -3,6 +3,7 @@
#include <boost/test/data/test_case.hpp>
#include <depend.h>
+#include <news.h>
#include <utils/ebuildCacheParser.h>
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/convenience.hpp>
@@ -35,3 +36,20 @@ BOOST_DATA_TEST_CASE( ebuildCacheDependencies, boost::unit_test::data::make(
testDependRange(ecp.getRange("PDEPEND"));
}
+BOOST_DATA_TEST_CASE( news, boost::unit_test::data::make(
+ getFileList("/usr/portage/metadata/news", boost::filesystem::is_regular_file)),
+ path )
+{
+ AdHoc::FileUtils::MemMap n(path);
+ auto news = Portage::Utils::News::parse(n.sv<gchar>());
+ BOOST_REQUIRE(news);
+ BOOST_CHECK(news->authoremail);
+ BOOST_CHECK(!news->authoremail->empty());
+ BOOST_CHECK(news->authorname);
+ BOOST_CHECK(!news->authorname->empty());
+ BOOST_CHECK(!news->body.empty());
+ BOOST_CHECK(!news->title.empty());
+ BOOST_CHECK_EQUAL(news->posted.length(), 10);
+ BOOST_CHECK(news->newsid.empty()); // From file name, not handled by parser
+}
+