aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2009-03-23 18:57:31 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2009-03-23 18:57:31 +0000
commit9f2c388c6954d13c7562d4e625fc786bc60f1c74 (patch)
tree3ce29b034160b99df313700c48357c8b070bdc76
parentd40b124656e5d24930e3206e65251757a769907c (diff)
downloadpaludis-9f2c388c6954d13c7562d4e625fc786bc60f1c74.tar.gz
paludis-9f2c388c6954d13c7562d4e625fc786bc60f1c74.tar.xz
FAIL
-rw-r--r--paludis/version_spec.cc10
-rw-r--r--paludis/version_spec_TEST.cc4
2 files changed, 10 insertions, 4 deletions
diff --git a/paludis/version_spec.cc b/paludis/version_spec.cc
index 72a2a3d..66185e7 100644
--- a/paludis/version_spec.cc
+++ b/paludis/version_spec.cc
@@ -416,8 +416,10 @@ namespace
if (result.second)
return result.first;
- ++v1;
- ++v2;
+ if (v1_end != v1)
+ ++v1;
+ if (v2_end != v2)
+ ++v2;
}
}
@@ -425,7 +427,7 @@ namespace
compare_comparator(const VersionSpecComponent & a, Parts::const_iterator, Parts::const_iterator,
const VersionSpecComponent & b, Parts::const_iterator, Parts::const_iterator, int compared)
{
- return std::make_pair(compared, compared != 0 || (a.type() == vsct_empty || b.type() == vsct_empty));
+ return std::make_pair(compared, compared != 0 || (a.type() == vsct_empty && b.type() == vsct_empty));
}
std::pair<bool, bool>
@@ -437,7 +439,7 @@ namespace
(b.type() == vsct_empty || b.type() == vsct_revision) &&
compared == 1, true);
else
- return std::make_pair(true, a.type() == vsct_empty || b.type() == vsct_empty);
+ return std::make_pair(true, a.type() == vsct_empty && b.type() == vsct_empty);
}
std::pair<bool, bool>
diff --git a/paludis/version_spec_TEST.cc b/paludis/version_spec_TEST.cc
index 22ffa4b..4b6fc33 100644
--- a/paludis/version_spec_TEST.cc
+++ b/paludis/version_spec_TEST.cc
@@ -246,6 +246,8 @@ namespace test_cases
TEST_CHECK(! VersionSpec("1.2.3", VersionSpecOptions()).tilde_compare(VersionSpec("1.2-r3", VersionSpecOptions())));
TEST_CHECK(! VersionSpec("1.2-r3", VersionSpecOptions()).tilde_compare(VersionSpec("1.2.3", VersionSpecOptions())));
+ TEST_CHECK(! VersionSpec("1.2", VersionSpecOptions()).tilde_compare(VersionSpec("1.2-r0.2", VersionSpecOptions())));
+ TEST_CHECK(! VersionSpec("1.2-r0.1", VersionSpecOptions()).tilde_compare(VersionSpec("1.2-r0.2", VersionSpecOptions())));
}
} test_version_spec_tilde_compare;
@@ -434,6 +436,8 @@ namespace test_cases
TEST_CHECK(VersionSpec("1.2", VersionSpecOptions()) == VersionSpec("1.2-r", VersionSpecOptions()));
TEST_CHECK(VersionSpec("1.2-r3", VersionSpecOptions()) == VersionSpec("1.2-r3.0", VersionSpecOptions()));
TEST_CHECK(VersionSpec("1.2", VersionSpecOptions()) == VersionSpec("1.2-r0.0", VersionSpecOptions()));
+ TEST_CHECK(VersionSpec("1.2", VersionSpecOptions()) != VersionSpec("1.2-r0.1", VersionSpecOptions()));
+ TEST_CHECK(VersionSpec("1.2-r0.1", VersionSpecOptions()) != VersionSpec("1.2", VersionSpecOptions()));
TEST_CHECK(VersionSpec("1_alpha_beta-scm", VersionSpecOptions()) == VersionSpec("1_alpha0_beta-scm", VersionSpecOptions()));
TEST_CHECK(VersionSpec("1_alpha_beta000_rc3-scm", VersionSpecOptions()) == VersionSpec("1_alpha00_beta_rc3-scm", VersionSpecOptions()));