diff options
Diffstat (limited to 'semver/tests/deprecation.rs')
-rw-r--r-- | semver/tests/deprecation.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/semver/tests/deprecation.rs b/semver/tests/deprecation.rs new file mode 100644 index 0000000..a5f533a --- /dev/null +++ b/semver/tests/deprecation.rs @@ -0,0 +1,22 @@ +extern crate semver; + +#[test] +fn test_regressions() { + use semver::VersionReq; + use semver::ReqParseError; + + let versions = vec![ + (".*", VersionReq::any()), + ("0.1.0.", VersionReq::parse("0.1.0").unwrap()), + ("0.3.1.3", VersionReq::parse("0.3.13").unwrap()), + ("0.2*", VersionReq::parse("0.2.*").unwrap()), + ("*.0", VersionReq::any()), + ]; + + for (version, requirement) in versions.into_iter() { + let parsed = VersionReq::parse(version); + let error = parsed.err().unwrap(); + + assert_eq!(ReqParseError::DeprecatedVersionRequirement(requirement), error); + } +} |