]> git.proxmox.com Git - rustc.git/blob - library/std/src/sys/unix/os/tests.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / library / std / src / sys / unix / os / tests.rs
1 use super::*;
2
3 #[test]
4 fn test_glibc_version() {
5 // This mostly just tests that the weak linkage doesn't panic wildly...
6 glibc_version();
7 }
8
9 #[test]
10 fn test_parse_glibc_version() {
11 let cases = [
12 ("0.0", Some((0, 0))),
13 ("01.+2", Some((1, 2))),
14 ("3.4.5.six", Some((3, 4))),
15 ("1", None),
16 ("1.-2", None),
17 ("1.foo", None),
18 ("foo.1", None),
19 ];
20 for &(version_str, parsed) in cases.iter() {
21 assert_eq!(parsed, parse_glibc_version(version_str));
22 }
23 }