diff options
author | Alec Warner <antarus@gentoo.org> | 2007-02-01 05:46:41 +0000 |
---|---|---|
committer | Alec Warner <antarus@gentoo.org> | 2007-02-01 05:46:41 +0000 |
commit | 11fff7a865f25fccf9d24086773b7410b9778cac (patch) | |
tree | 1820f0286f836b37248898cec3a1538432b2e879 | |
parent | 4c9b95eccf910b4b7530e2607e417508fb804e47 (diff) | |
download | portage-11fff7a865f25fccf9d24086773b7410b9778cac.tar.gz portage-11fff7a865f25fccf9d24086773b7410b9778cac.tar.bz2 portage-11fff7a865f25fccf9d24086773b7410b9778cac.zip |
increase test coverage to cover slots, uncovering a few corner cases that need fixing
svn path=/main/trunk/; revision=5856
-rw-r--r-- | tests/portage/dep/test_dep_getcpv.py | 3 | ||||
-rw-r--r-- | tests/portage/dep/test_get_operator.py | 15 |
2 files changed, 12 insertions, 6 deletions
diff --git a/tests/portage/dep/test_dep_getcpv.py b/tests/portage/dep/test_dep_getcpv.py index 857a408a3..f1561ed78 100644 --- a/tests/portage/dep/test_dep_getcpv.py +++ b/tests/portage/dep/test_dep_getcpv.py @@ -18,7 +18,8 @@ class DepGetCPV(TestCase): bad_prefix_ops = [ ">~", "<~", "~>", "~<" ] postfix_ops = [ "*", "" ] - cpvs = ["sys-apps/portage"] + cpvs = ["sys-apps/portage", "sys-apps/portage-2.1", "sys-apps/portage-2.1:", + "sys-apps/portage-2.1:2"] for cpv in cpvs: for prefix in prefix_ops: diff --git a/tests/portage/dep/test_get_operator.py b/tests/portage/dep/test_get_operator.py index 28485e0f0..b41fab0d5 100644 --- a/tests/portage/dep/test_get_operator.py +++ b/tests/portage/dep/test_get_operator.py @@ -16,11 +16,16 @@ class GetOperator(TestCase): ( ">~", ">" ), ("~<", "~"), ( "=~", "=" ), ( "=>", "=" ), ("=<", "=") ] - testCP = "sys-apps/portage" - - for test in tests: - result = get_operator( test[0] + testCP ) - self.assertEqual( result, test[1] ) + test_cpvs = ["sys-apps/portage","sys-apps/portage-2.1"] + slots = [ None,"1","linux-2.5.6" ] + for cpv in test_cpvs: + for test in tests: + for slot in slots: + atom = cpv[:] + if slot: + atom += ":" + slot + result = get_operator( test[0] + atom ) + self.assertEqual( result, test[1] ) result = get_operator( "=sys-apps/portage*" ) self.assertEqual( result , "=*" ) |