aboutsummaryrefslogtreecommitdiff
path: root/paludis/resolver/resolver_TEST_purges.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-31 10:07:38 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-31 10:19:55 +0100
commit338d1a830f7df6a5bdc9316c0e10c82e972e48de (patch)
tree68dc1930c7a25bde1a017d5d605f26735f8a0ada /paludis/resolver/resolver_TEST_purges.cc
parent8670fe36394fdcb7c93c8da69bb55fc804a85a4e (diff)
downloadpaludis-338d1a830f7df6a5bdc9316c0e10c82e972e48de.tar.gz
paludis-338d1a830f7df6a5bdc9316c0e10c82e972e48de.tar.xz
Handle :* deps properly
Fixes: ticket:941
Diffstat (limited to 'paludis/resolver/resolver_TEST_purges.cc')
-rw-r--r--paludis/resolver/resolver_TEST_purges.cc48
1 files changed, 48 insertions, 0 deletions
diff --git a/paludis/resolver/resolver_TEST_purges.cc b/paludis/resolver/resolver_TEST_purges.cc
index 82aa07476..7cb87cc43 100644
--- a/paludis/resolver/resolver_TEST_purges.cc
+++ b/paludis/resolver/resolver_TEST_purges.cc
@@ -33,6 +33,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/util/make_shared_copy.hh>
+#include <paludis/util/return_literal_function.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/repository_factory.hh>
#include <paludis/package_database.hh>
@@ -122,5 +123,52 @@ namespace test_cases
);
}
} test_purges;
+
+ struct TestStarSlotPurges : ResolverPurgesTestCase
+ {
+ TestStarSlotPurges() :
+ ResolverPurgesTestCase("star slot purges")
+ {
+ install("star-slot-purges", "target", "1")->set_slot(SlotName("1"));
+ install("star-slot-purges", "target", "2")->set_slot(SlotName("2"));
+
+ install("star-slot-purges", "uses", "1")->build_dependencies_key()->set_from_string("star-slot-purges/target:*");
+
+ allowed_to_remove_names->insert(QualifiedPackageName("star-slot-purges/target"));
+ }
+
+ virtual ResolverFunctions get_resolver_functions(InitialConstraints & initial_constraints)
+ {
+ ResolverFunctions result(ResolverPurgesTestCase::get_resolver_functions(initial_constraints));
+ result.get_use_existing_fn() = std::bind(&use_existing_if_possible_except_target, std::placeholders::_1,
+ std::placeholders::_2, std::placeholders::_3);
+ result.confirm_fn() = std::bind(return_literal_function(false));
+ return result;
+ }
+
+ void run()
+ {
+ std::shared_ptr<const Resolved> resolved(get_resolved(BlockDepSpec(
+ "!star-slot-purges/target:1",
+ parse_user_package_dep_spec("star-slot-purges/target:1", &env, { }),
+ false)));
+
+ check_resolved(resolved,
+ n::taken_change_or_remove_decisions() = make_shared_copy(DecisionChecks()
+ .remove(QualifiedPackageName("star-slot-purges/target"))
+ .finished()),
+ n::taken_unable_to_make_decisions() = make_shared_copy(DecisionChecks()
+ .finished()),
+ n::taken_unconfirmed_decisions() = make_shared_copy(DecisionChecks()
+ .finished()),
+ n::taken_unorderable_decisions() = make_shared_copy(DecisionChecks()
+ .finished()),
+ n::untaken_change_or_remove_decisions() = make_shared_copy(DecisionChecks()
+ .finished()),
+ n::untaken_unable_to_make_decisions() = make_shared_copy(DecisionChecks()
+ .finished())
+ );
+ }
+ } test_star_slot_purges;
}