Skip to content

Commit

Permalink
Add pre-release versions to wildcard test
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jun 4, 2021
1 parent b39b59b commit 4358bd0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_version_req.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,23 +264,23 @@ pub fn test_wildcard() {

let ref r = req("*");
assert_match_all(r, &["0.9.1", "2.9.0", "0.0.9", "1.0.1", "1.1.1"]);
assert_match_none(r, &[]);
assert_match_none(r, &["1.0.0-pre"]);

for s in &["x", "X"] {
assert_eq!(*r, req(s));
}

let ref r = req("1.*");
assert_match_all(r, &["1.2.0", "1.2.1", "1.1.1", "1.3.0"]);
assert_match_none(r, &["0.0.9"]);
assert_match_none(r, &["0.0.9", "1.2.0-pre"]);

for s in &["1.x", "1.X", "1.*.*"] {
assert_eq!(*r, req(s));
}

let ref r = req("1.2.*");
assert_match_all(r, &["1.2.0", "1.2.2", "1.2.4"]);
assert_match_none(r, &["1.9.0", "1.0.9", "2.0.1", "0.1.3"]);
assert_match_none(r, &["1.9.0", "1.0.9", "2.0.1", "0.1.3", "1.2.2-pre"]);

for s in &["1.2.x", "1.2.X"] {
assert_eq!(*r, req(s));
Expand Down

0 comments on commit 4358bd0

Please sign in to comment.