Fix potential collisions between file and hardlink tests when run in parallel

This commit is contained in:
Nathan Fisher 2023-12-18 00:12:35 -05:00
parent 03486321ed
commit 6d0b17c2d9

View File

@ -388,7 +388,7 @@ mod tests {
#[test]
fn file_node() {
{
let fd = fs::File::create("test/li.node").unwrap();
let fd = fs::File::create("test/file.node").unwrap();
let mut writer = BufWriter::new(fd);
let links = Mutex::new(HashMap::new());
let node = Node::from_path("test/li.txt", Algorithm::Sha256, &links).unwrap();
@ -411,7 +411,7 @@ mod tests {
node.write(&mut writer).unwrap();
}
let meta = fs::metadata("test/li.txt").unwrap();
let fd = fs::File::open("test/li.node").unwrap();
let fd = fs::File::open("test/file.node").unwrap();
let mut reader = BufReader::new(fd);
let node = Node::read(&mut reader).unwrap();
assert_eq!(meta.mode() & 0o777, node.mode as u32);