aboutsummaryrefslogtreecommitdiff
path: root/paludis/user_dep_spec_TEST.cc
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/user_dep_spec_TEST.cc')
-rw-r--r--paludis/user_dep_spec_TEST.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/paludis/user_dep_spec_TEST.cc b/paludis/user_dep_spec_TEST.cc
index 5d024047e..dff1e3d72 100644
--- a/paludis/user_dep_spec_TEST.cc
+++ b/paludis/user_dep_spec_TEST.cc
@@ -225,6 +225,14 @@ namespace test_cases
PackageDepSpec p(parse_user_package_dep_spec("foo/bar[.key=value]", &env, { }));
check_spec(p, "foo/bar", "", "", "", "", "", "", "", "[.key=value]");
+
+ TEST_CHECK_THROWS(parse_user_package_dep_spec("=foo/bar[.foo?q]", &env, { }), PackageDepSpecError);
+
+ PackageDepSpec q(parse_user_package_dep_spec("foo/bar[.foo?]", &env, { }));
+ check_spec(q, "foo/bar", "", "", "", "", "", "", "", "[.foo?]");
+
+ PackageDepSpec r(parse_user_package_dep_spec("foo/bar[.$short_description=value]", &env, { }));
+ check_spec(r, "foo/bar", "", "", "", "", "", "", "", "[.$short_description=value]");
}
} test_user_package_dep_spec;
@@ -468,6 +476,29 @@ namespace test_cases
PackageDepSpec l(parse_user_package_dep_spec("cat/pkg1[.HITCHHIKER>41]", &env, { }));
TEST_CHECK(match_package(env, l, *pkg1, { }));
+
+ PackageDepSpec m(parse_user_package_dep_spec("cat/pkg1[.HITCHHIKER?]", &env, { }));
+ TEST_CHECK(match_package(env, m, *pkg1, { }));
+
+ PackageDepSpec n(parse_user_package_dep_spec("cat/pkg1[.SPOON?]", &env, { }));
+ TEST_CHECK(! match_package(env, n, *pkg1, { }));
+
+ PackageDepSpec o(parse_user_package_dep_spec("cat/pkg1[.$keywords<~a]", &env, { }));
+ TEST_CHECK(match_package(env, o, *pkg1, { }));
+ TEST_CHECK(match_package(env, o, *pkg2, { }));
+ TEST_CHECK(! match_package(env, o, *pkg3, { }));
+
+ PackageDepSpec p(parse_user_package_dep_spec("cat/pkg1[.::$format=fake]", &env, { }));
+ TEST_CHECK(match_package(env, p, *pkg1, { }));
+
+ PackageDepSpec q(parse_user_package_dep_spec("cat/pkg1[.::$format=e]", &env, { }));
+ TEST_CHECK(! match_package(env, q, *pkg1, { }));
+
+ PackageDepSpec r(parse_user_package_dep_spec("cat/pkg1[.::format=fake]", &env, { }));
+ TEST_CHECK(match_package(env, r, *pkg1, { }));
+
+ PackageDepSpec s(parse_user_package_dep_spec("cat/pkg1[.::format=e]", &env, { }));
+ TEST_CHECK(! match_package(env, s, *pkg1, { }));
}
} test_user_package_dep_spec_user_key_req;
}