aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2015-11-08 22:31:38 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2015-11-08 22:31:38 +0000
commit27173447c84657a9aafe57b1b9bfb5c7087b0f39 (patch)
tree76042c6fec34ce2bfc94086a513340d42ed7ce4a
parent53e89a76f67868ec520ac0b6da4ce1301376ae04 (diff)
downloadpaludis-27173447c84657a9aafe57b1b9bfb5c7087b0f39.tar.gz
paludis-27173447c84657a9aafe57b1b9bfb5c7087b0f39.tar.xz
Unify =* behaviour
Gentoo changed =* to mean almost the same thing as it does in Exherbo in bug 560466; the difference being that float-like components aren't treated specially, for example 1.0123 doesn't match a dep saying =1.012*. Since nothing in Exherbo relies on this anyway, just make it the same everywhere.
-rw-r--r--paludis/elike_package_dep_spec.cc4
-rw-r--r--paludis/elike_package_dep_spec.se1
-rw-r--r--paludis/partially_made_package_dep_spec.cc8
-rw-r--r--paludis/repositories/e/e_repository_sets.cc2
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf2
-rw-r--r--paludis/resolver/decider.cc3
-rw-r--r--paludis/resolver/package_or_block_dep_spec.cc2
-rw-r--r--paludis/serialise.cc2
-rw-r--r--paludis/user_dep_spec.cc6
-rw-r--r--paludis/version_operator.cc9
-rw-r--r--paludis/version_operator.se3
-rw-r--r--paludis/version_spec.cc15
-rw-r--r--paludis/version_spec.hh9
-rw-r--r--paludis/version_spec_TEST.cc106
-rwxr-xr-xpython/version_operator_TEST.py2
15 files changed, 58 insertions, 116 deletions
diff --git a/paludis/elike_package_dep_spec.cc b/paludis/elike_package_dep_spec.cc
index cb70843..22f36d1 100644
--- a/paludis/elike_package_dep_spec.cc
+++ b/paludis/elike_package_dep_spec.cc
@@ -174,7 +174,7 @@ paludis::elike_remove_trailing_square_bracket_if_exists(std::string & s, Partial
{
ver.erase(ver.length() - 1);
if (vop == vo_equal)
- vop = options[epdso_nice_equal_star] ? vo_nice_equal_star : vo_stupid_equal_star;
+ vop = vo_equal_star;
else
throw PackageDepSpecError("Invalid use of * with operator '" + stringify(vop) + " inside []");
}
@@ -463,7 +463,7 @@ paludis::elike_get_remove_version_operator(std::string & s, const ELikePackageDe
{
if (op != vo_equal)
throw PackageDepSpecError("Package dep spec uses * with operator '" + stringify(op) + "'");
- op = options[epdso_nice_equal_star] ? vo_nice_equal_star : vo_stupid_equal_star;
+ op = vo_equal_star;
s.erase(s.length() - 1);
}
diff --git a/paludis/elike_package_dep_spec.se b/paludis/elike_package_dep_spec.se
index a82a75b..7344e5e 100644
--- a/paludis/elike_package_dep_spec.se
+++ b/paludis/elike_package_dep_spec.se
@@ -20,7 +20,6 @@ make_enum_ELikePackageDepSpecOption()
key epdso_allow_ranged_deps "Allow [op version] deps"
key epdso_allow_tilde_greater_deps "Allow ~> deps"
key epdso_disallow_nonranged_deps "Disallow >=foo/bar-1 deps"
- key epdso_nice_equal_star "Make =* do something sensible"
key epdso_strict_parsing "Error rather than warn for violations"
key epdso_allow_key_requirements "Allow [.key=value] requirements. \since 0.40"
}
diff --git a/paludis/partially_made_package_dep_spec.cc b/paludis/partially_made_package_dep_spec.cc
index 6caf317..e3fca24 100644
--- a/paludis/partially_made_package_dep_spec.cc
+++ b/paludis/partially_made_package_dep_spec.cc
@@ -123,7 +123,7 @@ namespace
else if (next(version_requirements_ptr()->begin()) == version_requirements_ptr()->end() &&
! options_for_partially_made_package_dep_spec_v[pmpdso_always_use_ranged_deps])
{
- if (version_requirements_ptr()->begin()->version_operator() == vo_stupid_equal_star || version_requirements_ptr()->begin()->version_operator() == vo_nice_equal_star)
+ if (version_requirements_ptr()->begin()->version_operator() == vo_equal_star)
s << "=";
else
s << version_requirements_ptr()->begin()->version_operator();
@@ -156,7 +156,7 @@ namespace
! options_for_partially_made_package_dep_spec_v[pmpdso_always_use_ranged_deps])
{
s << "-" << version_requirements_ptr()->begin()->version_spec();
- if (version_requirements_ptr()->begin()->version_operator() == vo_stupid_equal_star || version_requirements_ptr()->begin()->version_operator() == vo_nice_equal_star)
+ if (version_requirements_ptr()->begin()->version_operator() == vo_equal_star)
s << "*";
}
}
@@ -253,14 +253,14 @@ namespace
} while (false);
}
- if (r->version_operator() == vo_stupid_equal_star || r->version_operator() == vo_nice_equal_star)
+ if (r->version_operator() == vo_equal_star)
s << "=";
else
s << r->version_operator();
s << r->version_spec();
- if (r->version_operator() == vo_stupid_equal_star || r->version_operator() == vo_nice_equal_star)
+ if (r->version_operator() == vo_equal_star)
s << "*";
need_op = true;
diff --git a/paludis/repositories/e/e_repository_sets.cc b/paludis/repositories/e/e_repository_sets.cc
index 254568b..a7c332e 100644
--- a/paludis/repositories/e/e_repository_sets.cc
+++ b/paludis/repositories/e/e_repository_sets.cc
@@ -199,7 +199,7 @@ namespace
if (! ver.empty() && '*' == ver.at(ver.length() - 1))
{
ver.erase(ver.length() - 1);
- our_op = pds_options[epdso_nice_equal_star] ? vo_nice_equal_star : vo_stupid_equal_star;
+ our_op = vo_equal_star;
}
else
our_op = vo_equal;
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index 5b49ab3..a5a540a 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -9,7 +9,7 @@ is_pbin = false
package_dep_spec_parse_options = allow_slot_deps allow_use_deps \
allow_ranged_deps allow_tilde_greater_deps strict_parsing \
allow_slot_equal_deps allow_slot_star_deps allow_use_dep_defaults \
- nice_equal_star disallow_nonranged_deps allow_use_dep_question_defaults \
+ disallow_nonranged_deps allow_use_dep_question_defaults \
missing_use_deps_is_qa
dependency_spec_tree_parse_options = disallow_any_use uri_supports_arrow single_bang_block_is_hard
iuse_flag_parse_options = strict_parsing
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index 0101398..1af46ae 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -1189,8 +1189,7 @@ Decider::find_any_score(
case vo_equal:
case vo_tilde:
- case vo_nice_equal_star:
- case vo_stupid_equal_star:
+ case vo_equal_star:
case vo_tilde_greater:
local_score = os_equal;
break;
diff --git a/paludis/resolver/package_or_block_dep_spec.cc b/paludis/resolver/package_or_block_dep_spec.cc
index 26ce16d..3202ddd 100644
--- a/paludis/resolver/package_or_block_dep_spec.cc
+++ b/paludis/resolver/package_or_block_dep_spec.cc
@@ -104,7 +104,7 @@ PackageOrBlockDepSpec::deserialise(Deserialisation & d, const std::shared_ptr<co
bool block(v.member<bool>("block"));
PackageDepSpec spec(parse_elike_package_dep_spec(v.member<std::string>("spec"),
- { epdso_allow_tilde_greater_deps, epdso_nice_equal_star,
+ { epdso_allow_tilde_greater_deps,
epdso_allow_ranged_deps, epdso_allow_use_deps, epdso_allow_use_deps_portage,
epdso_allow_use_dep_defaults, epdso_allow_repository_deps, epdso_allow_slot_star_deps,
epdso_allow_slot_equal_deps, epdso_allow_slot_equal_deps_portage,
diff --git a/paludis/serialise.cc b/paludis/serialise.cc
index 0016e99..24f18be 100644
--- a/paludis/serialise.cc
+++ b/paludis/serialise.cc
@@ -371,7 +371,7 @@ DeserialisatorHandler<std::shared_ptr<const PackageID> >::handle(Deserialisation
return *(*v.deserialiser().environment())[
selection::RequireExactlyOne(generator::Matches(
parse_elike_package_dep_spec(v.string_value(),
- { epdso_allow_tilde_greater_deps, epdso_nice_equal_star,
+ { epdso_allow_tilde_greater_deps,
epdso_allow_ranged_deps, epdso_allow_use_deps, epdso_allow_use_deps_portage,
epdso_allow_use_dep_defaults, epdso_allow_repository_deps, epdso_allow_slot_star_deps,
epdso_allow_slot_equal_deps, epdso_allow_slot_equal_deps_portage,
diff --git a/paludis/user_dep_spec.cc b/paludis/user_dep_spec.cc
index 379205e..b23a0c5 100644
--- a/paludis/user_dep_spec.cc
+++ b/paludis/user_dep_spec.cc
@@ -206,7 +206,7 @@ namespace
{
ver.erase(ver.length() - 1);
if (vop == vo_equal)
- vop = vo_nice_equal_star;
+ vop = vo_equal_star;
else
throw PackageDepSpecError("Invalid use of * with operator '" + stringify(vop) + " inside []");
}
@@ -372,7 +372,7 @@ paludis::parse_user_package_dep_spec(const std::string & ss, const Environment *
n::get_remove_trailing_version() = std::bind(&elike_get_remove_trailing_version, _1,
user_version_spec_options()),
n::get_remove_version_operator() = std::bind(&elike_get_remove_version_operator, _1,
- ELikePackageDepSpecOptions() + epdso_allow_tilde_greater_deps + epdso_nice_equal_star),
+ ELikePackageDepSpecOptions() + epdso_allow_tilde_greater_deps),
n::has_version_operator() = std::bind(&elike_has_version_operator, _1,
std::cref(had_bracket_version_requirements), ELikePackageDepSpecOptions()),
n::options_for_partially_made_package_dep_spec() = std::bind(&fixed_options_for_partially_made_package_dep_spec, std::cref(o)),
@@ -400,7 +400,7 @@ paludis::envless_parse_package_dep_spec_for_tests(const std::string & ss)
n::get_remove_trailing_version() = std::bind(&elike_get_remove_trailing_version, _1,
user_version_spec_options()),
n::get_remove_version_operator() = std::bind(&elike_get_remove_version_operator, _1,
- ELikePackageDepSpecOptions() + epdso_allow_tilde_greater_deps + epdso_nice_equal_star),
+ ELikePackageDepSpecOptions() + epdso_allow_tilde_greater_deps),
n::has_version_operator() = std::bind(&elike_has_version_operator, _1,
std::cref(had_bracket_version_requirements), ELikePackageDepSpecOptions()),
n::options_for_partially_made_package_dep_spec() = std::bind(&fixed_options_for_partially_made_package_dep_spec, std::cref(o)),
diff --git a/paludis/version_operator.cc b/paludis/version_operator.cc
index 673c010..1c540aa 100644
--- a/paludis/version_operator.cc
+++ b/paludis/version_operator.cc
@@ -99,8 +99,7 @@ paludis::operator<< (std::ostream & s, const VersionOperator & v)
s << "<=";
continue;
- case vo_nice_equal_star:
- case vo_stupid_equal_star:
+ case vo_equal_star:
s << "=*";
continue;
@@ -146,10 +145,8 @@ VersionOperator::as_version_spec_comparator() const
return &relational_operators::operator> <const VersionSpec>;
case vo_greater_equal:
return &relational_operators::operator>= <const VersionSpec>;
- case vo_nice_equal_star:
- return &member_to_comparator<&VersionSpec::nice_equal_star_compare>;
- case vo_stupid_equal_star:
- return &member_to_comparator<&VersionSpec::stupid_equal_star_compare>;
+ case vo_equal_star:
+ return &member_to_comparator<&VersionSpec::equal_star_compare>;
case vo_tilde_greater:
return &member_to_comparator<&VersionSpec::tilde_greater_compare>;
case last_vo:
diff --git a/paludis/version_operator.se b/paludis/version_operator.se
index 98a3d65..1ba7250 100644
--- a/paludis/version_operator.se
+++ b/paludis/version_operator.se
@@ -11,8 +11,7 @@ make_enum_VersionOperatorValue()
key vo_tilde "~ dependency"
key vo_greater "> dependency"
key vo_greater_equal ">= dependency"
- key vo_nice_equal_star "=* dependency (sensible EAPIs)"
- key vo_stupid_equal_star "=* dependency (Gentooish EAPIs)"
+ key vo_equal_star "=* dependency"
key vo_tilde_greater "~> dependency (gems)"
doxygen_comment << "END"
diff --git a/paludis/version_spec.cc b/paludis/version_spec.cc
index 6eb4c0a..5b2fba5 100644
--- a/paludis/version_spec.cc
+++ b/paludis/version_spec.cc
@@ -479,14 +479,11 @@ namespace
}
std::pair<bool, bool>
- nice_equal_star_compare_comparator(const VersionSpecComponent & a, Parts::const_iterator, Parts::const_iterator,
+ equal_star_compare_comparator(const VersionSpecComponent & a, Parts::const_iterator, Parts::const_iterator,
const VersionSpecComponent & b, Parts::const_iterator b_it, Parts::const_iterator b_it_end, int compared)
{
if (b.type() == vsct_empty)
return std::make_pair(true, true);
- else if (a.type() == vsct_floatlike && b.type() == vsct_floatlike && next(b_it) == b_it_end &&
- a.number_value().compare(0, b.number_value().length(), b.number_value()) == 0)
- return std::make_pair(true, true);
else if (a.type() == b.type() && next(b_it) == b_it_end &&
(b.type() == vsct_alpha || b.type() == vsct_beta || b.type() == vsct_pre ||
b.type() == vsct_rc || b.type() == vsct_patch) &&
@@ -510,15 +507,9 @@ VersionSpec::tilde_compare(const VersionSpec & other) const
}
bool
-VersionSpec::nice_equal_star_compare(const VersionSpec & other) const
-{
- return componentwise_compare(_imp->parts, other._imp->parts, nice_equal_star_compare_comparator);
-}
-
-bool
-VersionSpec::stupid_equal_star_compare(const VersionSpec & other) const
+VersionSpec::equal_star_compare(const VersionSpec & other) const
{
- return 0 == _imp->text.compare(0, other._imp->text.length(), other._imp->text);
+ return componentwise_compare(_imp->parts, other._imp->parts, equal_star_compare_comparator);
}
std::size_t
diff --git a/paludis/version_spec.hh b/paludis/version_spec.hh
index ecffc4a..9ab414a 100644
--- a/paludis/version_spec.hh
+++ b/paludis/version_spec.hh
@@ -156,14 +156,9 @@ namespace paludis
bool tilde_greater_compare(const VersionSpec & other) const;
/**
- * Comparison function for =* depend operator in sensible EAPIs.
+ * Comparison function for =* depend operator.
*/
- bool nice_equal_star_compare(const VersionSpec & other) const;
-
- /**
- * Comparison function for =* depend operator in Gentooish EAPIs.
- */
- bool stupid_equal_star_compare(const VersionSpec & other) const;
+ bool equal_star_compare(const VersionSpec & other) const;
/**
* Compare to another version.
diff --git a/paludis/version_spec_TEST.cc b/paludis/version_spec_TEST.cc
index 19ab039..e02c5e2 100644
--- a/paludis/version_spec_TEST.cc
+++ b/paludis/version_spec_TEST.cc
@@ -99,80 +99,42 @@ TEST(VersionSpec, TrickyParses)
ASSERT_TRUE(v3 == VersionSpec("1.2_pre2_pre3_pre4", { }));
}
-TEST(VersionSpec, StupidStar)
-{
- ASSERT_TRUE(VersionSpec("1.2", { }).stupid_equal_star_compare(VersionSpec("1", { })));
- ASSERT_TRUE(VersionSpec("1.2", { }).stupid_equal_star_compare(VersionSpec("1.2", { })));
- ASSERT_TRUE(VersionSpec("1.2.1", { }).stupid_equal_star_compare(VersionSpec("1", { })));
- ASSERT_TRUE(VersionSpec("1.2.1", { }).stupid_equal_star_compare(VersionSpec("1.2", { })));
- ASSERT_TRUE(VersionSpec("2.2", { }).stupid_equal_star_compare(VersionSpec("2", { })));
- ASSERT_TRUE(VersionSpec("2", { }).stupid_equal_star_compare(VersionSpec("2", { })));
- ASSERT_TRUE(VersionSpec("2.59", { }).stupid_equal_star_compare(VersionSpec("2.5", { })));
- ASSERT_TRUE(VersionSpec("2.59_alpha5-r1", { }).stupid_equal_star_compare(VersionSpec("2.59_alpha", { })));
- ASSERT_TRUE(! VersionSpec("2", { }).stupid_equal_star_compare(VersionSpec("2.5", { })));
- ASSERT_TRUE(! VersionSpec("2.59", { }).stupid_equal_star_compare(VersionSpec("2.50", { })));
- ASSERT_TRUE(! VersionSpec("1", { }).stupid_equal_star_compare(VersionSpec("2", { })));
-
- ASSERT_TRUE(! VersionSpec("01", { }).stupid_equal_star_compare(VersionSpec("1", { })));
- ASSERT_TRUE(! VersionSpec("1.02", { }).stupid_equal_star_compare(VersionSpec("1.020", { })));
- ASSERT_TRUE(VersionSpec("1.020", { }).stupid_equal_star_compare(VersionSpec("1.02", { })));
- ASSERT_TRUE(! VersionSpec("1_alpha1", { }).stupid_equal_star_compare(VersionSpec("1_alpha01", { })));
- ASSERT_TRUE(! VersionSpec("1_alpha01", { }).stupid_equal_star_compare(VersionSpec("1_alpha1", { })));
- ASSERT_TRUE(VersionSpec("1_alpha01", { }).stupid_equal_star_compare(VersionSpec("1_alpha0", { })));
- ASSERT_TRUE(VersionSpec("1_pre1", { }).stupid_equal_star_compare(VersionSpec("1_p", { })));
- ASSERT_TRUE(VersionSpec("1_pre-scm", { }).stupid_equal_star_compare(VersionSpec("1_pre", { })));
- ASSERT_TRUE(! VersionSpec("1_pre1", { }).stupid_equal_star_compare(VersionSpec("1_pre0", { })));
- ASSERT_TRUE(! VersionSpec("1_alpha1", { }).stupid_equal_star_compare(VersionSpec("1_alpha-r1", { })));
- ASSERT_TRUE(! VersionSpec("1_alpha1", { }).stupid_equal_star_compare(VersionSpec("1_beta", { })));
-
- ASSERT_TRUE(VersionSpec("010", { }).stupid_equal_star_compare(VersionSpec("010", { })));
- ASSERT_TRUE(VersionSpec("010", { }).stupid_equal_star_compare(VersionSpec("01", { })));
- ASSERT_TRUE(VersionSpec("2.010", { }).stupid_equal_star_compare(VersionSpec("2.01", { })));
- ASSERT_TRUE(VersionSpec("2.0105", { }).stupid_equal_star_compare(VersionSpec("2.010", { })));
- ASSERT_TRUE(! VersionSpec("2.0135", { }).stupid_equal_star_compare(VersionSpec("2.010", { })));
- ASSERT_TRUE(VersionSpec("2.010.1", { }).stupid_equal_star_compare(VersionSpec("2.01", { })));
- ASSERT_TRUE(VersionSpec("2.011.1", { }).stupid_equal_star_compare(VersionSpec("2.01", { })));
- ASSERT_TRUE(! VersionSpec("2.010.1", { }).stupid_equal_star_compare(VersionSpec("2.01.1", { })));
- ASSERT_TRUE(! VersionSpec("2.011.1", { }).stupid_equal_star_compare(VersionSpec("2.01.1", { })));
- ASSERT_TRUE(VersionSpec("2.10", { }).stupid_equal_star_compare(VersionSpec("2.1", { })));
-}
-
TEST(VersionSpec, NiceStar)
{
- ASSERT_TRUE(VersionSpec("1.2", { }).nice_equal_star_compare(VersionSpec("1", { })));
- ASSERT_TRUE(VersionSpec("1.2", { }).nice_equal_star_compare(VersionSpec("1.2", { })));
- ASSERT_TRUE(VersionSpec("1.2.1", { }).nice_equal_star_compare(VersionSpec("1", { })));
- ASSERT_TRUE(VersionSpec("1.2.1", { }).nice_equal_star_compare(VersionSpec("1.2", { })));
- ASSERT_TRUE(VersionSpec("2.2", { }).nice_equal_star_compare(VersionSpec("2", { })));
- ASSERT_TRUE(VersionSpec("2", { }).nice_equal_star_compare(VersionSpec("2", { })));
- ASSERT_TRUE(! VersionSpec("2.59", { }).nice_equal_star_compare(VersionSpec("2.5", { })));
- ASSERT_TRUE(VersionSpec("2.59_alpha5-r1", { }).nice_equal_star_compare(VersionSpec("2.59_alpha", { })));
- ASSERT_TRUE(! VersionSpec("2", { }).nice_equal_star_compare(VersionSpec("2.5", { })));
- ASSERT_TRUE(! VersionSpec("2.59", { }).nice_equal_star_compare(VersionSpec("2.50", { })));
- ASSERT_TRUE(! VersionSpec("1", { }).nice_equal_star_compare(VersionSpec("2", { })));
-
- ASSERT_TRUE(VersionSpec("01", { }).nice_equal_star_compare(VersionSpec("1", { })));
- ASSERT_TRUE(VersionSpec("1.02", { }).nice_equal_star_compare(VersionSpec("1.020", { })));
- ASSERT_TRUE(VersionSpec("1.020", { }).nice_equal_star_compare(VersionSpec("1.02", { })));
- ASSERT_TRUE(VersionSpec("1_alpha1", { }).nice_equal_star_compare(VersionSpec("1_alpha01", { })));
- ASSERT_TRUE(VersionSpec("1_alpha01", { }).nice_equal_star_compare(VersionSpec("1_alpha1", { })));
- ASSERT_TRUE(! VersionSpec("1_alpha01", { }).nice_equal_star_compare(VersionSpec("1_alpha0", { })));
- ASSERT_TRUE(! VersionSpec("1_pre1", { }).nice_equal_star_compare(VersionSpec("1_p", { })));
- ASSERT_TRUE(VersionSpec("1_pre-scm", { }).nice_equal_star_compare(VersionSpec("1_pre", { })));
- ASSERT_TRUE(! VersionSpec("1_pre1", { }).nice_equal_star_compare(VersionSpec("1_pre0", { })));
- ASSERT_TRUE(! VersionSpec("1_alpha1", { }).nice_equal_star_compare(VersionSpec("1_alpha-r1", { })));
- ASSERT_TRUE(! VersionSpec("1_alpha1", { }).nice_equal_star_compare(VersionSpec("1_beta", { })));
-
- ASSERT_TRUE(VersionSpec("010", { }).nice_equal_star_compare(VersionSpec("010", { })));
- ASSERT_TRUE(! VersionSpec("010", { }).nice_equal_star_compare(VersionSpec("01", { })));
- ASSERT_TRUE(VersionSpec("2.010", { }).nice_equal_star_compare(VersionSpec("2.01", { })));
- ASSERT_TRUE(VersionSpec("2.0105", { }).nice_equal_star_compare(VersionSpec("2.010", { })));
- ASSERT_TRUE(! VersionSpec("2.0135", { }).nice_equal_star_compare(VersionSpec("2.010", { })));
- ASSERT_TRUE(VersionSpec("2.010.1", { }).nice_equal_star_compare(VersionSpec("2.01", { })));
- ASSERT_TRUE(VersionSpec("2.011.1", { }).nice_equal_star_compare(VersionSpec("2.01", { })));
- ASSERT_TRUE(VersionSpec("2.010.1", { }).nice_equal_star_compare(VersionSpec("2.01.1", { })));
- ASSERT_TRUE(! VersionSpec("2.011.1", { }).stupid_equal_star_compare(VersionSpec("2.01.1", { })));
- ASSERT_TRUE(! VersionSpec("2.10", { }).nice_equal_star_compare(VersionSpec("2.1", { })));
+ ASSERT_TRUE(VersionSpec("1.2", { }).equal_star_compare(VersionSpec("1", { })));
+ ASSERT_TRUE(VersionSpec("1.2", { }).equal_star_compare(VersionSpec("1.2", { })));
+ ASSERT_TRUE(VersionSpec("1.2.1", { }).equal_star_compare(VersionSpec("1", { })));
+ ASSERT_TRUE(VersionSpec("1.2.1", { }).equal_star_compare(VersionSpec("1.2", { })));
+ ASSERT_TRUE(VersionSpec("2.2", { }).equal_star_compare(VersionSpec("2", { })));
+ ASSERT_TRUE(VersionSpec("2", { }).equal_star_compare(VersionSpec("2", { })));
+ ASSERT_TRUE(! VersionSpec("2.59", { }).equal_star_compare(VersionSpec("2.5", { })));
+ ASSERT_TRUE(VersionSpec("2.59_alpha5-r1", { }).equal_star_compare(VersionSpec("2.59_alpha", { })));
+ ASSERT_TRUE(! VersionSpec("2", { }).equal_star_compare(VersionSpec("2.5", { })));
+ ASSERT_TRUE(! VersionSpec("2.59", { }).equal_star_compare(VersionSpec("2.50", { })));
+ ASSERT_TRUE(! VersionSpec("1", { }).equal_star_compare(VersionSpec("2", { })));
+
+ ASSERT_TRUE(VersionSpec("01", { }).equal_star_compare(VersionSpec("1", { })));
+ ASSERT_TRUE(VersionSpec("1.02", { }).equal_star_compare(VersionSpec("1.020", { })));
+ ASSERT_TRUE(VersionSpec("1.020", { }).equal_star_compare(VersionSpec("1.02", { })));
+ ASSERT_TRUE(VersionSpec("1_alpha1", { }).equal_star_compare(VersionSpec("1_alpha01", { })));
+ ASSERT_TRUE(VersionSpec("1_alpha01", { }).equal_star_compare(VersionSpec("1_alpha1", { })));
+ ASSERT_TRUE(! VersionSpec("1_alpha01", { }).equal_star_compare(VersionSpec("1_alpha0", { })));
+ ASSERT_TRUE(! VersionSpec("1_pre1", { }).equal_star_compare(VersionSpec("1_p", { })));
+ ASSERT_TRUE(VersionSpec("1_pre-scm", { }).equal_star_compare(VersionSpec("1_pre", { })));
+ ASSERT_TRUE(! VersionSpec("1_pre1", { }).equal_star_compare(VersionSpec("1_pre0", { })));
+ ASSERT_TRUE(! VersionSpec("1_alpha1", { }).equal_star_compare(VersionSpec("1_alpha-r1", { })));
+ ASSERT_TRUE(! VersionSpec("1_alpha1", { }).equal_star_compare(VersionSpec("1_beta", { })));
+
+ ASSERT_TRUE(VersionSpec("010", { }).equal_star_compare(VersionSpec("010", { })));
+ ASSERT_TRUE(! VersionSpec("010", { }).equal_star_compare(VersionSpec("01", { })));
+ ASSERT_TRUE(VersionSpec("2.010", { }).equal_star_compare(VersionSpec("2.01", { })));
+ ASSERT_TRUE(! VersionSpec("2.0105", { }).equal_star_compare(VersionSpec("2.010", { })));
+ ASSERT_TRUE(! VersionSpec("2.0135", { }).equal_star_compare(VersionSpec("2.010", { })));
+ ASSERT_TRUE(VersionSpec("2.010.1", { }).equal_star_compare(VersionSpec("2.01", { })));
+ ASSERT_TRUE(! VersionSpec("2.011.1", { }).equal_star_compare(VersionSpec("2.01", { })));
+ ASSERT_TRUE(VersionSpec("2.010.1", { }).equal_star_compare(VersionSpec("2.01.1", { })));
+ ASSERT_TRUE(! VersionSpec("2.011.1", { }).equal_star_compare(VersionSpec("2.01.1", { })));
+ ASSERT_TRUE(! VersionSpec("2.10", { }).equal_star_compare(VersionSpec("2.1", { })));
}
TEST(VersionSpec, Tilde)
diff --git a/python/version_operator_TEST.py b/python/version_operator_TEST.py
index ef1b4a1..96118d9 100755
--- a/python/version_operator_TEST.py
+++ b/python/version_operator_TEST.py
@@ -36,7 +36,7 @@ class TestCase_VersionOperator(unittest.TestCase):
def test_04_compare(self):
self.assert_(VersionOperator("<").compare(VersionSpec("1.0"), VersionSpec("2.0")))
self.assert_(VersionOperator(">").compare(VersionSpec("3.0"), VersionSpec("2.0")))
- self.assert_(VersionOperator(VersionOperatorValue.STUPID_EQUAL_STAR).compare(VersionSpec("2.0.1-r1"), VersionSpec("2.0")))
+ self.assert_(VersionOperator(VersionOperatorValue.EQUAL_STAR).compare(VersionSpec("2.0.1-r1"), VersionSpec("2.0")))
if __name__ == "__main__":
unittest.main()