aboutsummaryrefslogtreecommitdiff
path: root/paludis/filter_TEST.cc
diff options
context:
space:
mode:
authorAvatar Paul Mulders <info@mld.demon.nl> 2010-03-06 13:04:31 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-03-06 12:23:28 +0000
commit4f64c70b09cd995fbd9cd2b36f59f1164a0013c0 (patch)
treed3c0a62fbc2331ee99e9675d355eabf617d22a31 /paludis/filter_TEST.cc
parent7a58de7637da67d8420cab0b69c79bbb376a5688 (diff)
downloadpaludis-4f64c70b09cd995fbd9cd2b36f59f1164a0013c0.tar.gz
paludis-4f64c70b09cd995fbd9cd2b36f59f1164a0013c0.tar.xz
Implement filter::Matches.
Diffstat (limited to 'paludis/filter_TEST.cc')
-rw-r--r--paludis/filter_TEST.cc75
1 files changed, 75 insertions, 0 deletions
diff --git a/paludis/filter_TEST.cc b/paludis/filter_TEST.cc
index a96669ade..13495b509 100644
--- a/paludis/filter_TEST.cc
+++ b/paludis/filter_TEST.cc
@@ -217,5 +217,80 @@ namespace test_cases
"cat/c-3:0::repo2";
}
} not_masked_and_installable_filter_test;
+
+ struct MatchesFilterTestCase : FilterTestCaseBase
+ {
+ MatchesFilterTestCase() :
+ FilterTestCaseBase("matches", filter::Matches(parse_user_package_dep_spec("cat/a",
+ &env, UserPackageDepSpecOptions()), MatchPackageOptions()))
+ {
+ }
+
+ virtual std::string get_expected() const
+ {
+ return
+ "cat/a-1:0::inst_repo1, "
+ "cat/a-1:0::repo1, "
+ "cat/a-1:0::repo2, "
+ "cat/a-2:0::repo2";
+ }
+ } matches_filter_test;
+
+ struct MatchesCatWildcardFilterTestCase : FilterTestCaseBase
+ {
+ MatchesCatWildcardFilterTestCase() :
+ FilterTestCaseBase("matches cat wildcard", filter::Matches(parse_user_package_dep_spec("*/a",
+ &env, UserPackageDepSpecOptions() + updso_allow_wildcards), MatchPackageOptions()))
+ {
+ }
+
+ virtual std::string get_expected() const
+ {
+ return
+ "cat/a-1:0::inst_repo1, "
+ "cat/a-1:0::repo1, "
+ "cat/a-1:0::repo2, "
+ "cat/a-2:0::repo2";
+ }
+ } matches_cat_wildcard_filter_test;
+
+ struct MatchesPkgWildcardFilterTestCase : FilterTestCaseBase
+ {
+ MatchesPkgWildcardFilterTestCase() :
+ FilterTestCaseBase("matches pkg wildcard", filter::Matches(parse_user_package_dep_spec("cat/*",
+ &env, UserPackageDepSpecOptions() + updso_allow_wildcards), MatchPackageOptions()))
+ {
+ }
+
+ virtual std::string get_expected() const
+ {
+ return
+ "cat/a-1:0::inst_repo1, "
+ "cat/a-1:0::repo1, "
+ "cat/a-1:0::repo2, "
+ "cat/a-2:0::repo2, "
+ "cat/b-2:0::repo1, "
+ "cat/c-3:0::repo2";
+ }
+ } matches_pkg_wildcard_filter_test;
+
+ struct MatchesAllWildcardFilterTestCase : FilterTestCaseBase
+ {
+ MatchesAllWildcardFilterTestCase() :
+ FilterTestCaseBase("matches all wildcard", filter::Matches(
+ parse_user_package_dep_spec(">=*/*-2",
+ &env, UserPackageDepSpecOptions() + updso_allow_wildcards), MatchPackageOptions()))
+ {
+ }
+
+ virtual std::string get_expected() const
+ {
+ return
+ "cat/a-2:0::repo2, "
+ "cat/b-2:0::repo1, "
+ "cat/c-3:0::repo2";
+ }
+ } matches_all_wildcard_filter_test;
+
}