Skip to content

Commit

Permalink
Add tests for inverted version ranges (thanks skral!)
Browse files Browse the repository at this point in the history
  • Loading branch information
instinct-vfx committed Apr 26, 2019
1 parent 675bee1 commit d35da2c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/rez/vendor/version/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,15 @@ def _inv(a, b):
_eq("10+,<20", "10+<20")
_eq("1+<1.0", "1+<1.0")
_eq(">=2", "2+")
_eq(">=1.21.1,<1.23", ">=1.21.1<1.23")
_eq(">1.21.1,<1.23", ">1.21.1<1.23")
_eq(">1.21.1<1.23", ">1.21.1<1.23")
_eq(">1.21.1,<=1.23", ">1.21.1<=1.23")

# Reverse order which is a syntax pip packages use more often now.
# Only allowed when separated by a comma.
_eq("<1.23,>=1.21.1", ">=1.21.1<1.23")
_eq("<1.23,>1.21.1", ">1.21.1<1.23")

# optimised cases
_eq("3|3", "3")
Expand Down Expand Up @@ -305,7 +314,7 @@ def _inv(a, b):
"><", # both greater and less than empty version
">3>4", # both are lower bounds
"<3<4", # both are upper bounds
"<4>3", # upper bound before lower
"<4>3", # upper bound before lower without comma
",<4", # leading comma
"4+,", # trailing comma
"1>=", # pre-lower-op in post
Expand Down

0 comments on commit d35da2c

Please sign in to comment.