Add more tests for build metadata.
This commit is contained in:
parent
9ba32f306a
commit
31d29d394f
|
@ -318,6 +318,8 @@ fn test_parse() {
|
||||||
fn test_eq() {
|
fn test_eq() {
|
||||||
assert_eq!(parse("1.2.3"), parse("1.2.3"));
|
assert_eq!(parse("1.2.3"), parse("1.2.3"));
|
||||||
assert_eq!(parse("1.2.3-alpha1"), parse("1.2.3-alpha1"));
|
assert_eq!(parse("1.2.3-alpha1"), parse("1.2.3-alpha1"));
|
||||||
|
assert_eq!(parse("1.2.3+build.42"), parse("1.2.3+build.42"));
|
||||||
|
assert_eq!(parse("1.2.3-alpha1+42"), parse("1.2.3-alpha1+42"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -326,6 +328,7 @@ fn test_ne() {
|
||||||
assert!(parse("0.0.0") != parse("0.1.0"));
|
assert!(parse("0.0.0") != parse("0.1.0"));
|
||||||
assert!(parse("0.0.0") != parse("1.0.0"));
|
assert!(parse("0.0.0") != parse("1.0.0"));
|
||||||
assert!(parse("1.2.3-alpha") != parse("1.2.3-beta"));
|
assert!(parse("1.2.3-alpha") != parse("1.2.3-beta"));
|
||||||
|
assert!(parse("1.2.3+23") != parse("1.2.3+42"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -336,6 +339,7 @@ fn test_lt() {
|
||||||
assert!(parse("1.2.3-alpha1") < parse("1.2.3"));
|
assert!(parse("1.2.3-alpha1") < parse("1.2.3"));
|
||||||
assert!(parse("1.2.3-alpha1") < parse("1.2.3-alpha2"));
|
assert!(parse("1.2.3-alpha1") < parse("1.2.3-alpha2"));
|
||||||
assert!(!(parse("1.2.3-alpha2") < parse("1.2.3-alpha2")));
|
assert!(!(parse("1.2.3-alpha2") < parse("1.2.3-alpha2")));
|
||||||
|
assert!(!(parse("1.2.3+23") < parse("1.2.3+42")));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -345,6 +349,7 @@ fn test_le() {
|
||||||
assert!(parse("1.2.0") <= parse("1.2.3-alpha2"));
|
assert!(parse("1.2.0") <= parse("1.2.3-alpha2"));
|
||||||
assert!(parse("1.2.3-alpha1") <= parse("1.2.3-alpha2"));
|
assert!(parse("1.2.3-alpha1") <= parse("1.2.3-alpha2"));
|
||||||
assert!(parse("1.2.3-alpha2") <= parse("1.2.3-alpha2"));
|
assert!(parse("1.2.3-alpha2") <= parse("1.2.3-alpha2"));
|
||||||
|
assert!(parse("1.2.3+23") <= parse("1.2.3+42"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -355,6 +360,7 @@ fn test_gt() {
|
||||||
assert!(parse("1.2.3-alpha2") > parse("1.2.3-alpha1"));
|
assert!(parse("1.2.3-alpha2") > parse("1.2.3-alpha1"));
|
||||||
assert!(parse("1.2.3") > parse("1.2.3-alpha2"));
|
assert!(parse("1.2.3") > parse("1.2.3-alpha2"));
|
||||||
assert!(!(parse("1.2.3-alpha2") > parse("1.2.3-alpha2")));
|
assert!(!(parse("1.2.3-alpha2") > parse("1.2.3-alpha2")));
|
||||||
|
assert!(!(parse("1.2.3+23") > parse("1.2.3+42")));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -364,6 +370,7 @@ fn test_ge() {
|
||||||
assert!(parse("1.2.3-alpha2") >= parse("1.2.0"));
|
assert!(parse("1.2.3-alpha2") >= parse("1.2.0"));
|
||||||
assert!(parse("1.2.3-alpha2") >= parse("1.2.3-alpha1"));
|
assert!(parse("1.2.3-alpha2") >= parse("1.2.3-alpha1"));
|
||||||
assert!(parse("1.2.3-alpha2") >= parse("1.2.3-alpha2"));
|
assert!(parse("1.2.3-alpha2") >= parse("1.2.3-alpha2"));
|
||||||
|
assert!(parse("1.2.3+23") >= parse("1.2.3+42"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Reference in New Issue