summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-03-28 01:01:06 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2022-03-28 01:01:06 +0100
commitf8e60a9486692ee809665ad592a44ef6e0562bd0 (patch)
tree40d5d48c4250ce3f915a5f35ae4cb95e802059c8
parentUsers service with rw/ro pools using new IceTray features (diff)
downloadgentoobrowse-api-f8e60a9486692ee809665ad592a44ef6e0562bd0.tar.bz2
gentoobrowse-api-f8e60a9486692ee809665ad592a44ef6e0562bd0.tar.xz
gentoobrowse-api-f8e60a9486692ee809665ad592a44ef6e0562bd0.zip
Allow underscore in category namesgentoobrowse-api-0.12.0.1
-rw-r--r--gentoobrowse-api/service/depend.cpp2
-rw-r--r--gentoobrowse-api/unittests/testDepend.cpp11
-rw-r--r--gentoobrowse-api/unittests/testProcessAll.cpp6
3 files changed, 15 insertions, 4 deletions
diff --git a/gentoobrowse-api/service/depend.cpp b/gentoobrowse-api/service/depend.cpp
index e2ce15e..37f09e5 100644
--- a/gentoobrowse-api/service/depend.cpp
+++ b/gentoobrowse-api/service/depend.cpp
@@ -19,7 +19,7 @@ namespace Portage::Utils {
AdHoc::Lexer::PatternPtr AtomSpec(AdHoc::LexerMatchers::regex(
"\\s*"
"([[:punct:]]+)?" // op
- "([[:alnum:]-]+)\\/" // cat
+ "([[:alnum:]-_]+)\\/" // cat
"([^ ]+)" // package
"(-([0-9][.0-9]*[[:alpha:]]?\\*?((_(alpha|beta|pre|rc|p))?[[:digit:]]*)*(-r[[:digit:]]+)?))?" // version
"(:([^/ []+(\\/[^ []+)?))?" // slot
diff --git a/gentoobrowse-api/unittests/testDepend.cpp b/gentoobrowse-api/unittests/testDepend.cpp
index 0ac212b..a02c87a 100644
--- a/gentoobrowse-api/unittests/testDepend.cpp
+++ b/gentoobrowse-api/unittests/testDepend.cpp
@@ -282,6 +282,17 @@ BOOST_AUTO_TEST_CASE(freeciv)
BOOST_REQUIRE_EQUAL(ds.size(), 27);
}
+BOOST_AUTO_TEST_CASE(wine_staging)
+{
+ auto ds = Portage::Utils::Depend::parse(
+ "mingw? ( "
+ "!!>=cross-i686-w64-mingw32/binutils-2.38 !!>=cross-x86_64-w64-mingw32/binutils-2.38 ) mono? ( "
+ "app-emulation/wine-mono:7.1.1 ) perl? ( dev-lang/perl dev-perl/XML-Simple ) pulseaudio? ( realtime? ( "
+ "sys-auth/rtkit ) ) samba? ( >=net-fs/samba-3.0.25[winbind] ) selinux? ( sec-policy/selinux-wine ) udisks? "
+ "( sys-fs/udisks:2 )");
+ BOOST_REQUIRE_EQUAL(ds.size(), 9);
+}
+
BOOST_AUTO_TEST_CASE(useWithAtSymble)
{
auto ds = Portage::Utils::Depend::parse("some@thing? ( app-arch/bzip2 )");
diff --git a/gentoobrowse-api/unittests/testProcessAll.cpp b/gentoobrowse-api/unittests/testProcessAll.cpp
index 1074018..8b4d2a9 100644
--- a/gentoobrowse-api/unittests/testProcessAll.cpp
+++ b/gentoobrowse-api/unittests/testProcessAll.cpp
@@ -39,9 +39,9 @@ BOOST_DATA_TEST_CASE(ebuildCacheDependencies,
path)
{
Gentoo::Utils::EbuildCacheParser ecp(path);
- testDependRange(ecp.getRange("DEPEND"));
- testDependRange(ecp.getRange("RDEPEND"));
- testDependRange(ecp.getRange("PDEPEND"));
+ BOOST_CHECK_NO_THROW(testDependRange(ecp.getRange("DEPEND")));
+ BOOST_CHECK_NO_THROW(testDependRange(ecp.getRange("RDEPEND")));
+ BOOST_CHECK_NO_THROW(testDependRange(ecp.getRange("PDEPEND")));
}
BOOST_DATA_TEST_CASE(news,