• Home
  • Raw
  • Download

Lines Matching full:version

3 // Licensed under the Apache License, Version 2.0 (the "License");
16 use semver::{Version, VersionReq};
21 /// Ignore semantic version. Consider any two versions compatible.
25 /// Follow standard semantic version rules, under which 0.x and 0.y are incompatible.
30 /// Returns true if the object version is upgradable to 'other', according to
31 /// the specified semantic version compatibility strictness.
34 other: &Version, in is_upgradable_to() argument
39 impl IsUpgradableTo for semver::Version { implementation
42 other: &Version, in is_upgradable_to() argument
53 /// Returns true if the version matches the req, according to the
57 version: &Version, in matches_with_compatibility_rule() argument
64 version: &Version, in matches_with_compatibility_rule() argument
72 && version.major == 0 in matches_with_compatibility_rule()
74 let mut fake_v = version.clone(); in matches_with_compatibility_rule()
80 self.matches(version) in matches_with_compatibility_rule()
83 SemverCompatibilityRule::Strict => self.matches(version), in matches_with_compatibility_rule()
96 let version = Version::parse("2.3.4")?; in test_is_upgradable() localVariable
97 let patch = Version::parse("2.3.5")?; in test_is_upgradable()
98 let minor = Version::parse("2.4.0")?; in test_is_upgradable()
99 let major = Version::parse("3.0.0")?; in test_is_upgradable()
100 let older = Version::parse("2.3.3")?; in test_is_upgradable()
104 version.is_upgradable_to(&patch, SemverCompatibilityRule::Strict), in test_is_upgradable()
108 version.is_upgradable_to(&patch, SemverCompatibilityRule::Loose), in test_is_upgradable()
112 version.is_upgradable_to(&patch, SemverCompatibilityRule::Ignore), in test_is_upgradable()
117 version.is_upgradable_to(&minor, SemverCompatibilityRule::Strict), in test_is_upgradable()
118 "Minor version update, strict" in test_is_upgradable()
121 version.is_upgradable_to(&minor, SemverCompatibilityRule::Loose), in test_is_upgradable()
122 "Minor version update, loose" in test_is_upgradable()
125 version.is_upgradable_to(&minor, SemverCompatibilityRule::Ignore), in test_is_upgradable()
126 "Minor version update, ignore" in test_is_upgradable()
130 !version.is_upgradable_to(&major, SemverCompatibilityRule::Strict), in test_is_upgradable()
131 "Incompatible (major version) update, strict" in test_is_upgradable()
134 !version.is_upgradable_to(&major, SemverCompatibilityRule::Loose), in test_is_upgradable()
135 "Incompatible (major version) update, loose" in test_is_upgradable()
138 version.is_upgradable_to(&major, SemverCompatibilityRule::Ignore), in test_is_upgradable()
139 "Incompatible (major version) update, ignore" in test_is_upgradable()
143 !version.is_upgradable_to(&older, SemverCompatibilityRule::Strict), in test_is_upgradable()
147 !version.is_upgradable_to(&older, SemverCompatibilityRule::Loose), in test_is_upgradable()
151 !version.is_upgradable_to(&older, SemverCompatibilityRule::Ignore), in test_is_upgradable()
160 let version = Version::parse("0.3.4")?; in test_is_upgradable_major_zero() localVariable
161 let patch = Version::parse("0.3.5")?; in test_is_upgradable_major_zero()
162 let minor = Version::parse("0.4.0")?; in test_is_upgradable_major_zero()
163 let major = Version::parse("1.0.0")?; in test_is_upgradable_major_zero()
164 let older = Version::parse("0.3.3")?; in test_is_upgradable_major_zero()
167 version.is_upgradable_to(&patch, SemverCompatibilityRule::Strict), in test_is_upgradable_major_zero()
171 version.is_upgradable_to(&patch, SemverCompatibilityRule::Loose), in test_is_upgradable_major_zero()
175 version.is_upgradable_to(&patch, SemverCompatibilityRule::Ignore), in test_is_upgradable_major_zero()
179 // Different behavior for minor version changes. in test_is_upgradable_major_zero()
181 !version.is_upgradable_to(&minor, SemverCompatibilityRule::Strict), in test_is_upgradable_major_zero()
182 "Minor version update, strict" in test_is_upgradable_major_zero()
185 version.is_upgradable_to(&minor, SemverCompatibilityRule::Loose), in test_is_upgradable_major_zero()
186 "Minor version update, loose" in test_is_upgradable_major_zero()
189 version.is_upgradable_to(&minor, SemverCompatibilityRule::Ignore), in test_is_upgradable_major_zero()
190 "Minor version update, ignore" in test_is_upgradable_major_zero()
194 !version.is_upgradable_to(&major, SemverCompatibilityRule::Strict), in test_is_upgradable_major_zero()
195 "Incompatible (major version) update, strict" in test_is_upgradable_major_zero()
198 !version.is_upgradable_to(&major, SemverCompatibilityRule::Loose), in test_is_upgradable_major_zero()
199 "Incompatible (major version) update, loose" in test_is_upgradable_major_zero()
202 version.is_upgradable_to(&major, SemverCompatibilityRule::Ignore), in test_is_upgradable_major_zero()
203 "Incompatible (major version) update, ignore" in test_is_upgradable_major_zero()
207 !version.is_upgradable_to(&older, SemverCompatibilityRule::Strict), in test_is_upgradable_major_zero()
211 !version.is_upgradable_to(&older, SemverCompatibilityRule::Loose), in test_is_upgradable_major_zero()
215 !version.is_upgradable_to(&older, SemverCompatibilityRule::Ignore), in test_is_upgradable_major_zero()