Skip to content

Commit

Permalink
Add tests for post versions (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh authored Mar 14, 2024
1 parent 9f304e0 commit cc53f35
Showing 1 changed file with 194 additions and 0 deletions.
194 changes: 194 additions & 0 deletions scenarios/post.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
[
{
"name": "post-simple",
"description": "A simple version constraint should not match a post-release version.",
"root": {
"requires": [
"a==1.2.3"
]
},
"packages": {
"a": {
"versions": {
"1.2.3.post1": {}
}
}
},
"expected": {
"satisfiable": false
}
},
{
"name": "post-greater-than-or-equal",
"description": "A greater-than-or-equal version constraint should match a post-release version.",
"root": {
"requires": [
"a>=1.2.3"
]
},
"packages": {
"a": {
"versions": {
"1.2.3.post1": {}
}
}
},
"expected": {
"satisfiable": true,
"packages": {
"a": "1.2.3.post1"
},
"explanation": "The version '1.2.3.post1' satisfies the constraint '>=1.2.3'."
}
},
{
"name": "post-greater-than",
"description": "A greater-than version constraint should not match a post-release version.",
"root": {
"requires": [
"a>1.2.3"
]
},
"packages": {
"a": {
"versions": {
"1.2.3.post1": {}
}
}
},
"expected": {
"satisfiable": false
}
},
{
"name": "post-greater-than-post",
"description": "A greater-than version constraint should match a post-release version if the constraint is itself a post-release version.",
"root": {
"requires": [
"a>1.2.3.post0"
]
},
"packages": {
"a": {
"versions": {
"1.2.3.post0": {},
"1.2.3.post1": {}
}
}
},
"expected": {
"satisfiable": true,
"packages": {
"a": "1.2.3.post1"
},
"explanation": "The version '1.2.3.post1' satisfies the constraint '>1.2.3.post0'."
}
},
{
"name": "post-greater-than-or-equal-post",
"description": "A greater-than-or-equal version constraint should match a post-release version if the constraint is itself a post-release version.",
"root": {
"requires": [
"a>=1.2.3.post0"
]
},
"packages": {
"a": {
"versions": {
"1.2.3.post0": {},
"1.2.3.post1": {}
}
}
},
"expected": {
"satisfiable": true,
"packages": {
"a": "1.2.3.post1"
},
"explanation": "The version '1.2.3.post1' satisfies the constraint '>=1.2.3.post0'."
}
},
{
"name": "post-less-than-or-equal",
"description": "A less-than-or-equal version constraint should not match a post-release version.",
"root": {
"requires": [
"a<=1.2.3"
]
},
"packages": {
"a": {
"versions": {
"1.2.3.post1": {}
}
}
},
"expected": {
"satisfiable": false
}
},
{
"name": "post-less-than",
"description": "A less-than version constraint should not match a post-release version.",
"root": {
"requires": [
"a<1.2.3"
]
},
"packages": {
"a": {
"versions": {
"1.2.3.post1": {}
}
}
},
"expected": {
"satisfiable": false
}
},
{
"name": "post-local-greater-than",
"description": "A greater-than version constraint should not match a post-release version with a local version identifier.",
"root": {
"requires": [
"a>1.2.3"
]
},
"packages": {
"a": {
"versions": {
"1.2.3.post1": {},
"1.2.3.post1+local": {}
}
}
},
"expected": {
"satisfiable": false
}
},
{
"name": "post-local-greater-than-post",
"description": "A greater-than version constraint should not match a post-release version with a local version identifier.",
"root": {
"requires": [
"a>1.2.3.post0"
]
},
"packages": {
"a": {
"versions": {
"1.2.3.post0": {},
"1.2.3.post0+local": {},
"1.2.3.post1": {}
}
}
},
"expected": {
"satisfiable": true,
"packages": {
"a": "1.2.3.post1"
},
"explanation": "The version '1.2.3.post1' satisfies the constraint '>1.2.3.post0'."
}
}
]

0 comments on commit cc53f35

Please sign in to comment.