Add function to invert constraints and ranges #91 - #92
Conversation
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
|
@pombredanne I made inversion of each comparator here: would like to get your opinion on this |
pombredanne
left a comment
There was a problem hiding this comment.
Thanks... see some comments for your review
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
pombredanne
left a comment
There was a problem hiding this comment.
Thanks!
see my review inline for your consideration.
IMHO the inversion should be first a method on a constraint and then second a range method that use the constraints method.
We would need a few unit tests rather than only data driven tests, and we could get fewer tests by removing duplicated tests.
Add unit tests for each kind Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
pombredanne
left a comment
There was a problem hiding this comment.
Thanks. Here are a few extra nit pickings for your consideration.
| assert str(result) == test_case["expected_vers"] | ||
|
|
||
|
|
||
| def test_inverse(): |
There was a problem hiding this comment.
You need tests for the lower level constraint.invert e.g., for https://github.com/nexB/univers/pull/92/files#diff-c77d34029ce1991650937489359eef45029f37be4f1f27c21f56e50e64209d9aR138 too
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tushar Goel tushar.goel.dav@gmail.com
We have invert of every operator:
But we don't have any inversion for star operator currently, what should we do for that ?