mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 17:36:19 +04:00
use fchown for ownership test
This commit is contained in:
parent
1531d7550a
commit
d65f965a0b
@ -690,11 +690,18 @@ async fn test_hardlink_write() -> anyhow::Result<()> {
|
|||||||
#[tokio::test(flavor = "multi_thread")]
|
#[tokio::test(flavor = "multi_thread")]
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
async fn test_write_ownership() -> anyhow::Result<()> {
|
async fn test_write_ownership() -> anyhow::Result<()> {
|
||||||
|
use std::os::unix::fs::MetadataExt;
|
||||||
|
|
||||||
let mut file = tempfile::NamedTempFile::new()?;
|
let mut file = tempfile::NamedTempFile::new()?;
|
||||||
let mut app = helpers::AppBuilder::new()
|
let mut app = helpers::AppBuilder::new()
|
||||||
.with_file(file.path(), None)
|
.with_file(file.path(), None)
|
||||||
.build()?;
|
.build()?;
|
||||||
|
|
||||||
|
let nobody_uid = 65534;
|
||||||
|
let nogroup_gid = 65534;
|
||||||
|
|
||||||
|
helix_stdx::faccess::fchown(&file.as_file_mut(), Some(nobody_uid), Some(nogroup_gid))?;
|
||||||
|
|
||||||
let old_meta = file.as_file().metadata()?;
|
let old_meta = file.as_file().metadata()?;
|
||||||
|
|
||||||
test_key_sequence(&mut app, Some("hello:w<ret>"), None, false).await?;
|
test_key_sequence(&mut app, Some("hello:w<ret>"), None, false).await?;
|
||||||
|
Loading…
Reference in New Issue
Block a user