Add regression test for #107495

This commit is contained in:
bjorn3 2024-03-19 10:04:32 +00:00
parent 1dea922ea6
commit 66a73f0c20
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,22 @@
extern crate run_make_support;
use run_make_support::{aux_build, tmp_dir};
use std::fs;
#[cfg(unix)]
use std::os::unix::fs::PermissionsExt;
use std::path::Path;
fn main() {
aux_build().arg("foo.rs").run();
verify(&tmp_dir().join("libfoo.rlib"));
}
fn verify(path: &Path) {
let perm = fs::metadata(path).unwrap().permissions();
assert!(!perm.readonly());
// Check that the file is readable for everyone
#[cfg(unix)]
assert_eq!(perm.mode(), 0o100664);
}