summaryrefslogtreecommitdiffstats
path: root/vendor/semver/tests/test_version.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /vendor/semver/tests/test_version.rs
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/semver/tests/test_version.rs')
-rw-r--r--vendor/semver/tests/test_version.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/vendor/semver/tests/test_version.rs b/vendor/semver/tests/test_version.rs
index de3628fac..991087f7d 100644
--- a/vendor/semver/tests/test_version.rs
+++ b/vendor/semver/tests/test_version.rs
@@ -47,6 +47,18 @@ fn test_parse() {
let err = version_err("1.2.3-01");
assert_to_string(err, "invalid leading zero in pre-release identifier");
+ let err = version_err("1.2.3++");
+ assert_to_string(err, "empty identifier segment in build metadata");
+
+ let err = version_err("07");
+ assert_to_string(err, "invalid leading zero in major version number");
+
+ let err = version_err("111111111111111111111.0.0");
+ assert_to_string(err, "value of major version number exceeds u64::MAX");
+
+ let err = version_err("8\0");
+ assert_to_string(err, "unexpected character '\\0' after major version number");
+
let parsed = version("1.2.3");
let expected = Version::new(1, 2, 3);
assert_eq!(parsed, expected);