]> git.lizzy.rs Git - rust.git/blob - library/std/src/sys/unix/os/tests.rs
Rollup merge of #102977 - lukas-code:is-sorted-hrtb, r=m-ou-se
[rust.git] / library / std / src / sys / unix / os / tests.rs
1 #[test]
2 #[cfg(all(target_os = "linux", target_env = "gnu"))]
3 fn test_glibc_version() {
4     // This mostly just tests that the weak linkage doesn't panic wildly...
5     super::glibc_version();
6 }
7
8 #[test]
9 #[cfg(all(target_os = "linux", target_env = "gnu"))]
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, super::parse_glibc_version(version_str));
22     }
23 }