Combine fifo node tests

This commit is contained in:
Nathan Fisher 2023-12-18 00:18:13 -05:00
parent 6d0b17c2d9
commit c2e377d09e
1 changed files with 1 additions and 23 deletions

View File

@ -354,16 +354,6 @@ mod tests {
assert_eq!(kind, Kind::Dir);
}
#[test]
fn get_kind_fifo() {
let _ = remove_file("test/fifo");
nix::mkfifo("test/fifo", 0o644).unwrap();
let meta = fs::symlink_metadata("test/fifo").unwrap();
let mode = meta.mode();
let kind = Kind::from(mode);
assert_eq!(kind, Kind::Pipe);
}
#[test]
#[cfg(target_os = "linux")]
fn get_kind_char() {
@ -373,18 +363,6 @@ mod tests {
assert_eq!(kind, Kind::Char);
}
#[test]
fn from_fifo_path() {
let _res = remove_file("test/fifo");
nix::mkfifo("test/fifo", 0o644).unwrap();
let links = Mutex::new(HashMap::new());
let node = Node::from_path("test/fifo", Algorithm::Skip, &links).unwrap();
let FileType::Fifo = node.filetype else {
eprintln!("Incorrect filetype: {:?}", node.filetype);
panic!();
};
}
#[test]
fn file_node() {
{
@ -515,7 +493,7 @@ mod tests {
}
#[test]
fn load_store_fifo() {
fn fifo_node() {
{
if PathBuf::from("test/fifo").exists() {
let _res = remove_file("test/fifo");