Combine fifo node tests
This commit is contained in:
parent
6d0b17c2d9
commit
c2e377d09e
24
src/node.rs
24
src/node.rs
@ -354,16 +354,6 @@ mod tests {
|
|||||||
assert_eq!(kind, Kind::Dir);
|
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]
|
#[test]
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
fn get_kind_char() {
|
fn get_kind_char() {
|
||||||
@ -373,18 +363,6 @@ mod tests {
|
|||||||
assert_eq!(kind, Kind::Char);
|
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]
|
#[test]
|
||||||
fn file_node() {
|
fn file_node() {
|
||||||
{
|
{
|
||||||
@ -515,7 +493,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn load_store_fifo() {
|
fn fifo_node() {
|
||||||
{
|
{
|
||||||
if PathBuf::from("test/fifo").exists() {
|
if PathBuf::from("test/fifo").exists() {
|
||||||
let _res = remove_file("test/fifo");
|
let _res = remove_file("test/fifo");
|
||||||
|
Loading…
Reference in New Issue
Block a user