MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_set_permissions

Function test_set_permissions

atomic-core/src/output/filesystem/tests.rs:569–580  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

567#[cfg(unix)]
568#[test]
569fn test_set_permissions() {
570 use std::os::unix::fs::PermissionsExt;
571
572 let (dir, fs) = temp_fs();
573 let path = dir.path().join("file.txt");
574 std::fs::write(&path, "content").unwrap();
575
576 fs.set_permissions("file.txt", 0o755).unwrap();
577
578 let perms = std::fs::metadata(&path).unwrap().permissions();
579 assert_eq!(perms.mode() & 0o777, 0o755);
580}
581
582#[test]
583fn test_is_writable_file() {

Callers

nothing calls this directly

Calls 6

temp_fsFunction · 0.85
writeFunction · 0.50
pathMethod · 0.45
unwrapMethod · 0.45
set_permissionsMethod · 0.45
permissionsMethod · 0.45

Tested by

no test coverage detected