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

Function test_set_permissions

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

Source from the content-addressed store, hash-verified

545#[cfg(unix)]
546#[test]
547fn test_set_permissions() {
548 use std::os::unix::fs::PermissionsExt;
549
550 let (dir, fs) = temp_fs();
551 let path = dir.path().join("file.txt");
552 std::fs::write(&path, "content").unwrap();
553
554 fs.set_permissions("file.txt", 0o755).unwrap();
555
556 let perms = std::fs::metadata(&path).unwrap().permissions();
557 assert_eq!(perms.mode() & 0o777, 0o755);
558}
559
560#[test]
561fn test_is_writable_file() {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected