sys: fs: move tests to a sub-module

This ensures that test code is not compiled in regular builds

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
This commit is contained in:
Lukas Wagner 2023-08-21 15:44:38 +02:00 committed by Thomas Lamprecht
parent 299a478f15
commit bcd134a349

View File

@ -152,16 +152,21 @@ fn create_path_at_do(
}
}
#[test]
fn test_create_path() {
create_path(
"testdir/testsub/testsub2/testfinal",
Some(CreateOptions::new().perm(stat::Mode::from_bits_truncate(0o755))),
Some(
CreateOptions::new()
.owner(nix::unistd::Uid::effective())
.group(nix::unistd::Gid::effective()),
),
)
.expect("expected create_path to work");
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_create_path() {
create_path(
"testdir/testsub/testsub2/testfinal",
Some(CreateOptions::new().perm(stat::Mode::from_bits_truncate(0o755))),
Some(
CreateOptions::new()
.owner(nix::unistd::Uid::effective())
.group(nix::unistd::Gid::effective()),
),
)
.expect("expected create_path to work");
}
}