aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-06 15:24:10 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-07 11:32:56 +0000
commit4d9e95cfc626a2f98262a267050250f30dc6b3bd (patch)
tree74dfd4f8f327a34e57ec6f00956e8d27f554708c
parent069c40621c0f9612b689448993f113d5f7ec96dd (diff)
downloadpaludis-4d9e95cfc626a2f98262a267050250f30dc6b3bd.tar.gz
paludis-4d9e95cfc626a2f98262a267050250f30dc6b3bd.tar.xz
Pass id to as_human_string
-rw-r--r--doc/api/cplusplus/examples/example_dep_spec.cc2
-rw-r--r--paludis/additional_package_dep_spec_requirement.hh8
-rw-r--r--paludis/elike_use_requirement.cc3
-rw-r--r--paludis/elike_use_requirement_TEST.cc170
-rw-r--r--paludis/user_dep_spec.cc10
-rw-r--r--paludis/user_dep_spec.hh5
6 files changed, 104 insertions, 94 deletions
diff --git a/doc/api/cplusplus/examples/example_dep_spec.cc b/doc/api/cplusplus/examples/example_dep_spec.cc
index 2e95985..081b201 100644
--- a/doc/api/cplusplus/examples/example_dep_spec.cc
+++ b/doc/api/cplusplus/examples/example_dep_spec.cc
@@ -133,7 +133,7 @@ int main(int argc, char * argv[])
if (need_join)
cout << " and ";
- cout << (*u)->as_raw_string() + " (meaning: " + (*u)->as_human_string() + ")";
+ cout << (*u)->as_raw_string() + " (meaning: " + (*u)->as_human_string(make_null_shared_ptr()) + ")";
need_join = true;
}
cout << endl;
diff --git a/paludis/additional_package_dep_spec_requirement.hh b/paludis/additional_package_dep_spec_requirement.hh
index da8321d..318e75d 100644
--- a/paludis/additional_package_dep_spec_requirement.hh
+++ b/paludis/additional_package_dep_spec_requirement.hh
@@ -96,8 +96,14 @@ namespace paludis
/**
* Return a human readable string representation of ourself.
+ *
+ * \param spec_id The PackageID the spec comes from. May be null. Used for
+ * [use=] style dependencies.
+ *
+ * \since 0.58 takes spec_id
*/
- virtual const std::string as_human_string() const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual const std::string as_human_string(
+ const std::shared_ptr<const PackageID> & spec_id) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
* Return a raw string representation of ourself.
diff --git a/paludis/elike_use_requirement.cc b/paludis/elike_use_requirement.cc
index df196b1..e893a84 100644
--- a/paludis/elike_use_requirement.cc
+++ b/paludis/elike_use_requirement.cc
@@ -540,7 +540,8 @@ namespace
return result;
}
- virtual const std::string as_human_string() const
+ virtual const std::string as_human_string(
+ const std::shared_ptr<const PackageID> &) const
{
return join(_reqs.begin(), _reqs.end(), "; ", std::mem_fn(&UseRequirement::as_human_string));
}
diff --git a/paludis/elike_use_requirement_TEST.cc b/paludis/elike_use_requirement_TEST.cc
index 9c0fab6..1eb117c 100644
--- a/paludis/elike_use_requirement_TEST.cc
+++ b/paludis/elike_use_requirement_TEST.cc
@@ -74,25 +74,25 @@ namespace test_cases
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
parse_elike_use_requirement("enabled", std::shared_ptr<const PackageID>(), { euro_strict_parsing }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[enabled]");
- TEST_CHECK_EQUAL(req1->as_human_string(), "Flag 'enabled' enabled");
+ TEST_CHECK_EQUAL(req1->as_human_string(make_null_shared_ptr()), "Flag 'enabled' enabled");
TEST_CHECK(req1->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("disabled", std::shared_ptr<const PackageID>(), { euro_strict_parsing }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[disabled]");
- TEST_CHECK_EQUAL(req2->as_human_string(), "Flag 'disabled' enabled");
+ TEST_CHECK_EQUAL(req2->as_human_string(make_null_shared_ptr()), "Flag 'disabled' enabled");
TEST_CHECK(! req2->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
parse_elike_use_requirement("-enabled", std::shared_ptr<const PackageID>(), { euro_strict_parsing }));
TEST_CHECK_EQUAL(req3->as_raw_string(), "[-enabled]");
- TEST_CHECK_EQUAL(req3->as_human_string(), "Flag 'enabled' disabled");
+ TEST_CHECK_EQUAL(req3->as_human_string(make_null_shared_ptr()), "Flag 'enabled' disabled");
TEST_CHECK(! req3->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
parse_elike_use_requirement("-disabled", std::shared_ptr<const PackageID>(), { euro_strict_parsing }));
TEST_CHECK_EQUAL(req4->as_raw_string(), "[-disabled]");
- TEST_CHECK_EQUAL(req4->as_human_string(), "Flag 'disabled' disabled");
+ TEST_CHECK_EQUAL(req4->as_human_string(make_null_shared_ptr()), "Flag 'disabled' disabled");
TEST_CHECK(req4->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
}
} test_simple_use_requirements;
@@ -115,25 +115,25 @@ namespace test_cases
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
parse_elike_use_requirement("enabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[enabled]");
- TEST_CHECK_EQUAL(req1->as_human_string(), "Flag 'enabled' enabled");
+ TEST_CHECK_EQUAL(req1->as_human_string(make_null_shared_ptr()), "Flag 'enabled' enabled");
TEST_CHECK(req1->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("disabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[disabled]");
- TEST_CHECK_EQUAL(req2->as_human_string(), "Flag 'disabled' enabled");
+ TEST_CHECK_EQUAL(req2->as_human_string(make_null_shared_ptr()), "Flag 'disabled' enabled");
TEST_CHECK(! req2->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
parse_elike_use_requirement("-enabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req3->as_raw_string(), "[-enabled]");
- TEST_CHECK_EQUAL(req3->as_human_string(), "Flag 'enabled' disabled");
+ TEST_CHECK_EQUAL(req3->as_human_string(make_null_shared_ptr()), "Flag 'enabled' disabled");
TEST_CHECK(! req3->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
parse_elike_use_requirement("-disabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req4->as_raw_string(), "[-disabled]");
- TEST_CHECK_EQUAL(req4->as_human_string(), "Flag 'disabled' disabled");
+ TEST_CHECK_EQUAL(req4->as_human_string(make_null_shared_ptr()), "Flag 'disabled' disabled");
TEST_CHECK(req4->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
}
} test_simple_use_requirements_portage_syntax;
@@ -156,31 +156,31 @@ namespace test_cases
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
parse_elike_use_requirement("enabled,-disabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[enabled,-disabled]");
- TEST_CHECK_EQUAL(req1->as_human_string(), "Flag 'enabled' enabled; Flag 'disabled' disabled");
+ TEST_CHECK_EQUAL(req1->as_human_string(make_null_shared_ptr()), "Flag 'enabled' enabled; Flag 'disabled' disabled");
TEST_CHECK(req1->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("enabled,disabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[enabled,disabled]");
- TEST_CHECK_EQUAL(req2->as_human_string(), "Flag 'enabled' enabled; Flag 'disabled' enabled");
+ TEST_CHECK_EQUAL(req2->as_human_string(make_null_shared_ptr()), "Flag 'enabled' enabled; Flag 'disabled' enabled");
TEST_CHECK(! req2->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
parse_elike_use_requirement("-enabled,-disabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req3->as_raw_string(), "[-enabled,-disabled]");
- TEST_CHECK_EQUAL(req3->as_human_string(), "Flag 'enabled' disabled; Flag 'disabled' disabled");
+ TEST_CHECK_EQUAL(req3->as_human_string(make_null_shared_ptr()), "Flag 'enabled' disabled; Flag 'disabled' disabled");
TEST_CHECK(! req3->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
parse_elike_use_requirement("enabled,-disabled,-enabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req4->as_raw_string(), "[enabled,-disabled,-enabled]");
- TEST_CHECK_EQUAL(req4->as_human_string(), "Flag 'enabled' enabled; Flag 'disabled' disabled; Flag 'enabled' disabled");
+ TEST_CHECK_EQUAL(req4->as_human_string(make_null_shared_ptr()), "Flag 'enabled' enabled; Flag 'disabled' disabled; Flag 'enabled' disabled");
TEST_CHECK(! req4->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req5(
parse_elike_use_requirement("enabled,-disabled,enabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req5->as_raw_string(), "[enabled,-disabled,enabled]");
- TEST_CHECK_EQUAL(req5->as_human_string(), "Flag 'enabled' enabled; Flag 'disabled' disabled; Flag 'enabled' enabled");
+ TEST_CHECK_EQUAL(req5->as_human_string(make_null_shared_ptr()), "Flag 'enabled' enabled; Flag 'disabled' disabled; Flag 'enabled' enabled");
TEST_CHECK(req5->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
}
} test_multiple_use_requirements_portage_syntax;
@@ -205,84 +205,84 @@ namespace test_cases
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
parse_elike_use_requirement("pkgname?", id, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[pkgname?]");
- TEST_CHECK_EQUAL(req1->as_human_string(), "Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req1->as_human_string(id), "Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req1->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(! req1->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("pkgname?", id2, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[pkgname?]");
- TEST_CHECK_EQUAL(req2->as_human_string(), "Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req2->as_human_string(id2), "Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req2->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req2->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
parse_elike_use_requirement("-pkgname?", id, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req3->as_raw_string(), "[-pkgname?]");
- TEST_CHECK_EQUAL(req3->as_human_string(), "Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req3->as_human_string(id), "Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req3->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req3->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
parse_elike_use_requirement("-pkgname?", id2, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req4->as_raw_string(), "[-pkgname?]");
- TEST_CHECK_EQUAL(req4->as_human_string(), "Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req4->as_human_string(id2), "Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req4->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req4->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req5(
parse_elike_use_requirement("pkgname!?", id, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req5->as_raw_string(), "[pkgname!?]");
- TEST_CHECK_EQUAL(req5->as_human_string(), "Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req5->as_human_string(id), "Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req5->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req5->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req6(
parse_elike_use_requirement("pkgname!?", id2, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req6->as_raw_string(), "[pkgname!?]");
- TEST_CHECK_EQUAL(req6->as_human_string(), "Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req6->as_human_string(id2), "Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req6->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(! req6->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
parse_elike_use_requirement("-pkgname!?", id, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req7->as_raw_string(), "[-pkgname!?]");
- TEST_CHECK_EQUAL(req7->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req7->as_human_string(id), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req7->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req7->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
parse_elike_use_requirement("-pkgname!?", id2, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req8->as_raw_string(), "[-pkgname!?]");
- TEST_CHECK_EQUAL(req8->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req8->as_human_string(id2), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req8->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req8->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
parse_elike_use_requirement("pkgname=", id, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req9->as_raw_string(), "[pkgname=]");
- TEST_CHECK_EQUAL(req9->as_human_string(), "Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req9->as_human_string(id), "Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(req9->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(! req9->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
parse_elike_use_requirement("pkgname=", id2, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req10->as_raw_string(), "[pkgname=]");
- TEST_CHECK_EQUAL(req10->as_human_string(), "Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req10->as_human_string(id2), "Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req10->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req10->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
parse_elike_use_requirement("pkgname!=", id, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req11->as_raw_string(), "[pkgname!=]");
- TEST_CHECK_EQUAL(req11->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req11->as_human_string(id), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req11->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req11->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
parse_elike_use_requirement("pkgname!=", id2, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req12->as_raw_string(), "[pkgname!=]");
- TEST_CHECK_EQUAL(req12->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req12->as_human_string(id2), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(req12->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(! req12->requirement_met(&env, 0, id2, id2, 0).first);
}
@@ -308,56 +308,56 @@ namespace test_cases
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
parse_elike_use_requirement("pkgname?", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[pkgname?]");
- TEST_CHECK_EQUAL(req1->as_human_string(), "Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req1->as_human_string(id), "Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req1->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(! req1->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("pkgname?", id2, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[pkgname?]");
- TEST_CHECK_EQUAL(req2->as_human_string(), "Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req2->as_human_string(id2), "Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req2->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req2->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
parse_elike_use_requirement("!pkgname?", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req7->as_raw_string(), "[!pkgname?]");
- TEST_CHECK_EQUAL(req7->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req7->as_human_string(id), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req7->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req7->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
parse_elike_use_requirement("!pkgname?", id2, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req8->as_raw_string(), "[!pkgname?]");
- TEST_CHECK_EQUAL(req8->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req8->as_human_string(id2), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req8->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req8->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
parse_elike_use_requirement("pkgname=", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req9->as_raw_string(), "[pkgname=]");
- TEST_CHECK_EQUAL(req9->as_human_string(), "Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req9->as_human_string(id), "Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(req9->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(! req9->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
parse_elike_use_requirement("pkgname=", id2, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req10->as_raw_string(), "[pkgname=]");
- TEST_CHECK_EQUAL(req10->as_human_string(), "Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req10->as_human_string(id2), "Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req10->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req10->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
parse_elike_use_requirement("!pkgname=", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req11->as_raw_string(), "[!pkgname=]");
- TEST_CHECK_EQUAL(req11->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req11->as_human_string(id), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req11->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req11->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
parse_elike_use_requirement("!pkgname=", id2, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req12->as_raw_string(), "[!pkgname=]");
- TEST_CHECK_EQUAL(req12->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req12->as_human_string(id2), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(req12->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(! req12->requirement_met(&env, 0, id2, id2, 0).first);
}
@@ -383,112 +383,112 @@ namespace test_cases
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
parse_elike_use_requirement("pkgname?", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[pkgname?]");
- TEST_CHECK_EQUAL(req1->as_human_string(), "Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req1->as_human_string(id), "Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req1->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(! req1->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("pkgname?", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[pkgname?]");
- TEST_CHECK_EQUAL(req2->as_human_string(), "Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req2->as_human_string(id2), "Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req2->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req2->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
parse_elike_use_requirement("!pkgname?", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req7->as_raw_string(), "[!pkgname?]");
- TEST_CHECK_EQUAL(req7->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req7->as_human_string(id), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req7->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req7->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
parse_elike_use_requirement("!pkgname?", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req8->as_raw_string(), "[!pkgname?]");
- TEST_CHECK_EQUAL(req8->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req8->as_human_string(id2), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req8->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req8->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
parse_elike_use_requirement("pkgname=", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req9->as_raw_string(), "[pkgname=]");
- TEST_CHECK_EQUAL(req9->as_human_string(), "Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req9->as_human_string(id), "Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(req9->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(! req9->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
parse_elike_use_requirement("pkgname=", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req10->as_raw_string(), "[pkgname=]");
- TEST_CHECK_EQUAL(req10->as_human_string(), "Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req10->as_human_string(id2), "Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req10->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req10->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
parse_elike_use_requirement("!pkgname=", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req11->as_raw_string(), "[!pkgname=]");
- TEST_CHECK_EQUAL(req11->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req11->as_human_string(id), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req11->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req11->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
parse_elike_use_requirement("!pkgname=", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req12->as_raw_string(), "[!pkgname=]");
- TEST_CHECK_EQUAL(req12->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req12->as_human_string(id2), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(req12->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(! req12->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req13(
parse_elike_use_requirement("-pkgname?", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req13->as_raw_string(), "[-pkgname?]");
- TEST_CHECK_EQUAL(req13->as_human_string(), "Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req13->as_human_string(id), "Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req13->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req13->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req14(
parse_elike_use_requirement("-pkgname?", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req14->as_raw_string(), "[-pkgname?]");
- TEST_CHECK_EQUAL(req14->as_human_string(), "Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req14->as_human_string(id2), "Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req14->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req14->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req15(
parse_elike_use_requirement("pkgname!?", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req15->as_raw_string(), "[pkgname!?]");
- TEST_CHECK_EQUAL(req15->as_human_string(), "Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req15->as_human_string(id), "Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req15->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req15->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req16(
parse_elike_use_requirement("pkgname!?", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req16->as_raw_string(), "[pkgname!?]");
- TEST_CHECK_EQUAL(req16->as_human_string(), "Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req16->as_human_string(id2), "Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req16->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(! req16->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req17(
parse_elike_use_requirement("-pkgname!?", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req17->as_raw_string(), "[-pkgname!?]");
- TEST_CHECK_EQUAL(req17->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req17->as_human_string(id), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req17->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req17->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req18(
parse_elike_use_requirement("-pkgname!?", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req18->as_raw_string(), "[-pkgname!?]");
- TEST_CHECK_EQUAL(req18->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req18->as_human_string(id2), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req18->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req18->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req19(
parse_elike_use_requirement("pkgname!=", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req19->as_raw_string(), "[pkgname!=]");
- TEST_CHECK_EQUAL(req19->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req19->as_human_string(id), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req19->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req19->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req20(
parse_elike_use_requirement("pkgname!=", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req20->as_raw_string(), "[pkgname!=]");
- TEST_CHECK_EQUAL(req20->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req20->as_human_string(id2), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(req20->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(! req20->requirement_met(&env, 0, id2, id2, 0).first);
}
@@ -607,112 +607,112 @@ namespace test_cases
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
parse_elike_use_requirement("pkgname?", id, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[pkgname?]");
- TEST_CHECK_EQUAL(req1->as_human_string(), "Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req1->as_human_string(id), "Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req1->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(! req1->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("pkgname?", id2, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[pkgname?]");
- TEST_CHECK_EQUAL(req2->as_human_string(), "Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req2->as_human_string(id2), "Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req2->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req2->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
parse_elike_use_requirement("!pkgname?", id, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req7->as_raw_string(), "[!pkgname?]");
- TEST_CHECK_EQUAL(req7->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req7->as_human_string(id), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req7->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req7->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
parse_elike_use_requirement("!pkgname?", id2, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req8->as_raw_string(), "[!pkgname?]");
- TEST_CHECK_EQUAL(req8->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req8->as_human_string(id2), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req8->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req8->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
parse_elike_use_requirement("pkgname=", id, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req9->as_raw_string(), "[pkgname=]");
- TEST_CHECK_EQUAL(req9->as_human_string(), "Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req9->as_human_string(id), "Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(req9->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(! req9->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
parse_elike_use_requirement("pkgname=", id2, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req10->as_raw_string(), "[pkgname=]");
- TEST_CHECK_EQUAL(req10->as_human_string(), "Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req10->as_human_string(id2), "Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req10->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req10->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
parse_elike_use_requirement("!pkgname=", id, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req11->as_raw_string(), "[!pkgname=]");
- TEST_CHECK_EQUAL(req11->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req11->as_human_string(id), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req11->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req11->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
parse_elike_use_requirement("!pkgname=", id2, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req12->as_raw_string(), "[!pkgname=]");
- TEST_CHECK_EQUAL(req12->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req12->as_human_string(id2), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(req12->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(! req12->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req13(
parse_elike_use_requirement("-pkgname?", id, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req13->as_raw_string(), "[-pkgname?]");
- TEST_CHECK_EQUAL(req13->as_human_string(), "Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req13->as_human_string(id), "Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req13->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req13->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req14(
parse_elike_use_requirement("-pkgname?", id2, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req14->as_raw_string(), "[-pkgname?]");
- TEST_CHECK_EQUAL(req14->as_human_string(), "Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req14->as_human_string(id2), "Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req14->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req14->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req15(
parse_elike_use_requirement("pkgname!?", id, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req15->as_raw_string(), "[pkgname!?]");
- TEST_CHECK_EQUAL(req15->as_human_string(), "Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req15->as_human_string(id), "Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req15->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req15->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req16(
parse_elike_use_requirement("pkgname!?", id2, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req16->as_raw_string(), "[pkgname!?]");
- TEST_CHECK_EQUAL(req16->as_human_string(), "Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req16->as_human_string(id2), "Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req16->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(! req16->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req17(
parse_elike_use_requirement("-pkgname!?", id, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req17->as_raw_string(), "[-pkgname!?]");
- TEST_CHECK_EQUAL(req17->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req17->as_human_string(id), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req17->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req17->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req18(
parse_elike_use_requirement("-pkgname!?", id2, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req18->as_raw_string(), "[-pkgname!?]");
- TEST_CHECK_EQUAL(req18->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req18->as_human_string(id2), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req18->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req18->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req19(
parse_elike_use_requirement("pkgname!=", id, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req19->as_raw_string(), "[pkgname!=]");
- TEST_CHECK_EQUAL(req19->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req19->as_human_string(id), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req19->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req19->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req20(
parse_elike_use_requirement("pkgname!=", id2, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req20->as_raw_string(), "[pkgname!=]");
- TEST_CHECK_EQUAL(req20->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req20->as_human_string(id2), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(req20->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(! req20->requirement_met(&env, 0, id2, id2, 0).first);
}
@@ -738,112 +738,112 @@ namespace test_cases
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
parse_elike_use_requirement("pkgname?", id, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[pkgname?]");
- TEST_CHECK_EQUAL(req1->as_human_string(), "Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req1->as_human_string(id), "Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req1->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(! req1->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("pkgname?", id2, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[pkgname?]");
- TEST_CHECK_EQUAL(req2->as_human_string(), "Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req2->as_human_string(id2), "Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req2->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req2->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
parse_elike_use_requirement("!pkgname?", id, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req7->as_raw_string(), "[!pkgname?]");
- TEST_CHECK_EQUAL(req7->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req7->as_human_string(id), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req7->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req7->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
parse_elike_use_requirement("!pkgname?", id2, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req8->as_raw_string(), "[!pkgname?]");
- TEST_CHECK_EQUAL(req8->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req8->as_human_string(id2), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req8->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req8->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
parse_elike_use_requirement("pkgname=", id, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req9->as_raw_string(), "[pkgname=]");
- TEST_CHECK_EQUAL(req9->as_human_string(), "Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req9->as_human_string(id), "Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(req9->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(! req9->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
parse_elike_use_requirement("pkgname=", id2, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req10->as_raw_string(), "[pkgname=]");
- TEST_CHECK_EQUAL(req10->as_human_string(), "Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req10->as_human_string(id2), "Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req10->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req10->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
parse_elike_use_requirement("!pkgname=", id, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req11->as_raw_string(), "[!pkgname=]");
- TEST_CHECK_EQUAL(req11->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req11->as_human_string(id), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req11->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req11->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
parse_elike_use_requirement("!pkgname=", id2, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req12->as_raw_string(), "[!pkgname=]");
- TEST_CHECK_EQUAL(req12->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req12->as_human_string(id2), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(req12->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(! req12->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req13(
parse_elike_use_requirement("-pkgname?", id, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req13->as_raw_string(), "[-pkgname?]");
- TEST_CHECK_EQUAL(req13->as_human_string(), "Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req13->as_human_string(id), "Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req13->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req13->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req14(
parse_elike_use_requirement("-pkgname?", id2, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req14->as_raw_string(), "[-pkgname?]");
- TEST_CHECK_EQUAL(req14->as_human_string(), "Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req14->as_human_string(id2), "Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req14->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req14->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req15(
parse_elike_use_requirement("pkgname!?", id, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req15->as_raw_string(), "[pkgname!?]");
- TEST_CHECK_EQUAL(req15->as_human_string(), "Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req15->as_human_string(id), "Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req15->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req15->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req16(
parse_elike_use_requirement("pkgname!?", id2, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req16->as_raw_string(), "[pkgname!?]");
- TEST_CHECK_EQUAL(req16->as_human_string(), "Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req16->as_human_string(id2), "Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req16->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(! req16->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req17(
parse_elike_use_requirement("-pkgname!?", id, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req17->as_raw_string(), "[-pkgname!?]");
- TEST_CHECK_EQUAL(req17->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req17->as_human_string(id), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req17->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req17->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req18(
parse_elike_use_requirement("-pkgname!?", id2, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req18->as_raw_string(), "[-pkgname!?]");
- TEST_CHECK_EQUAL(req18->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req18->as_human_string(id2), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req18->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req18->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req19(
parse_elike_use_requirement("pkgname!=", id, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req19->as_raw_string(), "[pkgname!=]");
- TEST_CHECK_EQUAL(req19->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req19->as_human_string(id), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req19->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req19->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req20(
parse_elike_use_requirement("pkgname!=", id2, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req20->as_raw_string(), "[pkgname!=]");
- TEST_CHECK_EQUAL(req20->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
+ TEST_CHECK_EQUAL(req20->as_human_string(id2), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(req20->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(! req20->requirement_met(&env, 0, id2, id2, 0).first);
}
@@ -867,25 +867,25 @@ namespace test_cases
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
parse_elike_use_requirement("missing(+)", std::shared_ptr<const PackageID>(), { euro_allow_default_values, euro_strict_parsing }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[missing(+)]");
- TEST_CHECK_EQUAL(req1->as_human_string(), "Flag 'missing' enabled, assuming enabled if missing");
+ TEST_CHECK_EQUAL(req1->as_human_string(make_null_shared_ptr()), "Flag 'missing' enabled, assuming enabled if missing");
TEST_CHECK(req1->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("missing(-)", std::shared_ptr<const PackageID>(), { euro_allow_default_values, euro_strict_parsing }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[missing(-)]");
- TEST_CHECK_EQUAL(req2->as_human_string(), "Flag 'missing' enabled, assuming disabled if missing");
+ TEST_CHECK_EQUAL(req2->as_human_string(make_null_shared_ptr()), "Flag 'missing' enabled, assuming disabled if missing");
TEST_CHECK(! req2->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
parse_elike_use_requirement("-missing(+)", std::shared_ptr<const PackageID>(), { euro_allow_default_values, euro_strict_parsing }));
TEST_CHECK_EQUAL(req3->as_raw_string(), "[-missing(+)]");
- TEST_CHECK_EQUAL(req3->as_human_string(), "Flag 'missing' disabled, assuming enabled if missing");
+ TEST_CHECK_EQUAL(req3->as_human_string(make_null_shared_ptr()), "Flag 'missing' disabled, assuming enabled if missing");
TEST_CHECK(! req3->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
parse_elike_use_requirement("-missing(-)", std::shared_ptr<const PackageID>(), { euro_allow_default_values, euro_strict_parsing }));
TEST_CHECK_EQUAL(req4->as_raw_string(), "[-missing(-)]");
- TEST_CHECK_EQUAL(req4->as_human_string(), "Flag 'missing' disabled, assuming disabled if missing");
+ TEST_CHECK_EQUAL(req4->as_human_string(make_null_shared_ptr()), "Flag 'missing' disabled, assuming disabled if missing");
TEST_CHECK(req4->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
}
} test_use_requirements_with_defaults;
diff --git a/paludis/user_dep_spec.cc b/paludis/user_dep_spec.cc
index 988ed8a..973a5b7 100644
--- a/paludis/user_dep_spec.cc
+++ b/paludis/user_dep_spec.cc
@@ -793,7 +793,7 @@ UserKeyRequirement::requirement_met(
const Environment * const env,
const ChangedChoices * const,
const std::shared_ptr<const PackageID> & id,
- const std::shared_ptr<const PackageID> &,
+ const std::shared_ptr<const PackageID> & from_id,
const ChangedChoices * const) const
{
Context context("When working out whether '" + stringify(*id) + "' matches " + as_raw_string() + ":");
@@ -873,19 +873,19 @@ UserKeyRequirement::requirement_met(
}
if (! key)
- return std::make_pair(false, as_human_string());
+ return std::make_pair(false, as_human_string(from_id));
if (_imp->op == '?')
- return std::make_pair(true, as_human_string());
+ return std::make_pair(true, as_human_string(from_id));
else
{
KeyComparator c(env, id, _imp->value, _imp->op);
- return std::make_pair(key->accept_returning<bool>(c), as_human_string());
+ return std::make_pair(key->accept_returning<bool>(c), as_human_string(from_id));
}
}
const std::string
-UserKeyRequirement::as_human_string() const
+UserKeyRequirement::as_human_string(const std::shared_ptr<const PackageID> &) const
{
std::string key_str;
if ((! _imp->key.empty()) && (_imp->key.at(0) == '$'))
diff --git a/paludis/user_dep_spec.hh b/paludis/user_dep_spec.hh
index 18b148b..53f3a76 100644
--- a/paludis/user_dep_spec.hh
+++ b/paludis/user_dep_spec.hh
@@ -83,7 +83,10 @@ namespace paludis
const std::shared_ptr<const PackageID> &,
const std::shared_ptr<const PackageID> &,
const ChangedChoices * const) const PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual const std::string as_human_string() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual const std::string as_human_string(
+ const std::shared_ptr<const PackageID> &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+
virtual const std::string as_raw_string() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual Tribool accumulate_changes_to_make_met(