X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/21248c0f00ee71412dbadc6ebf84011cf974346d..99fdd8034b4a5cdb0100a33d0b3d5e26079c1695:/test/libapt/parsedepends_test.cc?ds=sidebyside diff --git a/test/libapt/parsedepends_test.cc b/test/libapt/parsedepends_test.cc index f644599bd..f537542b4 100644 --- a/test/libapt/parsedepends_test.cc +++ b/test/libapt/parsedepends_test.cc @@ -31,6 +31,8 @@ static void parseDependency(bool const StripMultiArch, bool const ParseArchFlag "not-for-darwin [ !darwin-any ], " "cpu-for-me [ any-amd64 ], " "os-for-me [ linux-any ], " + "libc-for-me [ gnu-linux-any ], " + "libc-not-for-me [ musl-linux-any ], " "cpu-not-for-me [ any-armel ], " "os-not-for-me [ kfreebsd-any ], " "not-in-stage1 , " @@ -156,6 +158,26 @@ static void parseDependency(bool const StripMultiArch, bool const ParseArchFlag Start++; } + if (ParseArchFlags == true) { + Start = debListParser::ParseDepends(Start, End, Package, Version, Op, ParseArchFlags, StripMultiArch, ParseRestrictionsList); + EXPECT_EQ("libc-for-me", Package); + EXPECT_EQ("", Version); + EXPECT_EQ(Null | pkgCache::Dep::NoOp, Op); + } else { + EXPECT_EQ(true, 0 == debListParser::ParseDepends(Start, End, Package, Version, Op, ParseArchFlags, StripMultiArch, ParseRestrictionsList)); + Start = strstr(Start, ","); + Start++; + } + + if (ParseArchFlags == true) { + Start = debListParser::ParseDepends(Start, End, Package, Version, Op, ParseArchFlags, StripMultiArch, ParseRestrictionsList); + EXPECT_EQ("", Package); // libc-not-for-me + } else { + EXPECT_EQ(true, 0 == debListParser::ParseDepends(Start, End, Package, Version, Op, ParseArchFlags, StripMultiArch, ParseRestrictionsList)); + Start = strstr(Start, ","); + Start++; + } + if (ParseArchFlags == true) { Start = debListParser::ParseDepends(Start, End, Package, Version, Op, ParseArchFlags, StripMultiArch, ParseRestrictionsList); EXPECT_EQ("", Package); // cpu-not-for-me