aboutsummaryrefslogtreecommitdiff
path: root/paludis/user_dep_spec_TEST.cc
diff options
context:
space:
mode:
authorAvatar Benedikt Morbach <moben@exherbo.org> 2013-03-05 02:29:11 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-03-08 12:53:36 +0000
commit26c5ed12c5067a5d83437197379f65dfc4a06fcc (patch)
treee75ddf436c24efe12cdd08291056a12b5cb0da5a /paludis/user_dep_spec_TEST.cc
parentcab157fad7e41ec29d3989d3aebaefbf202de6bd (diff)
downloadpaludis-26c5ed12c5067a5d83437197379f65dfc4a06fcc.tar.gz
paludis-26c5ed12c5067a5d83437197379f65dfc4a06fcc.tar.xz
UserKeyRequirement: allow matching metadata for inequality
only for simple values. Note that this changes behaviour in the following way: Previously, any of '><=' would be treated as '='. Now, only '=' and '!' are respected and '<' and '>' always return false. The only simple value key which still takes all operators is <long> because there it makes sense.
Diffstat (limited to 'paludis/user_dep_spec_TEST.cc')
-rw-r--r--paludis/user_dep_spec_TEST.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/paludis/user_dep_spec_TEST.cc b/paludis/user_dep_spec_TEST.cc
index a5fbf9ea5..7b3cc6352 100644
--- a/paludis/user_dep_spec_TEST.cc
+++ b/paludis/user_dep_spec_TEST.cc
@@ -244,6 +244,12 @@ TEST_F(UserDepSpecTest, Parsing)
PackageDepSpec r(parse_user_package_dep_spec("foo/bar[.$short_description=value]", &env, { }));
check_spec(r, "foo/bar", "", "", "", "", "", "", "", "[.$short_description=value]");
+
+ PackageDepSpec s(parse_user_package_dep_spec("foo/bar[.key!=value]", &env, { }));
+ check_spec(s, "foo/bar", "", "", "", "", "", "", "", "[.key!=value]");
+
+ PackageDepSpec t(parse_user_package_dep_spec("foo/bar[.$short_description!=value]", &env, { }));
+ check_spec(t, "foo/bar", "", "", "", "", "", "", "", "[.$short_description!=value]");
}
TEST_F(UserDepSpecTest, Unspecified)
@@ -485,5 +491,20 @@ TEST_F(UserDepSpecTest, Keys)
PackageDepSpec s(parse_user_package_dep_spec("cat/pkg1[.::format=e]", &env, { }));
EXPECT_TRUE(! match_package(env, s, pkg1, make_null_shared_ptr(), { }));
+
+ PackageDepSpec t(parse_user_package_dep_spec("cat/pkg1[.HITCHHIKER!=42]", &env, { }));
+ EXPECT_TRUE(! match_package(env, t, pkg1, make_null_shared_ptr(), { }));
+
+ PackageDepSpec u(parse_user_package_dep_spec("cat/pkg1[.::$format!=fake]", &env, { }));
+ EXPECT_TRUE(! match_package(env, u, pkg1, make_null_shared_ptr(), { }));
+
+ PackageDepSpec v(parse_user_package_dep_spec("cat/pkg1[.::$format!=e]", &env, { }));
+ EXPECT_TRUE(match_package(env, v, pkg1, make_null_shared_ptr(), { }));
+
+ PackageDepSpec w(parse_user_package_dep_spec("cat/pkg1[.::format!=fake]", &env, { }));
+ EXPECT_TRUE(! match_package(env, w, pkg1, make_null_shared_ptr(), { }));
+
+ PackageDepSpec x(parse_user_package_dep_spec("cat/pkg1[.::format!=e]", &env, { }));
+ EXPECT_TRUE(match_package(env, x, pkg1, make_null_shared_ptr(), { }));
}