Fix potential collisions between file and hardlink tests when run in parallel
This commit is contained in:
parent
03486321ed
commit
6d0b17c2d9
@ -388,7 +388,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn file_node() {
|
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 mut writer = BufWriter::new(fd);
|
||||||
let links = Mutex::new(HashMap::new());
|
let links = Mutex::new(HashMap::new());
|
||||||
let node = Node::from_path("test/li.txt", Algorithm::Sha256, &links).unwrap();
|
let node = Node::from_path("test/li.txt", Algorithm::Sha256, &links).unwrap();
|
||||||
@ -411,7 +411,7 @@ mod tests {
|
|||||||
node.write(&mut writer).unwrap();
|
node.write(&mut writer).unwrap();
|
||||||
}
|
}
|
||||||
let meta = fs::metadata("test/li.txt").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 mut reader = BufReader::new(fd);
|
||||||
let node = Node::read(&mut reader).unwrap();
|
let node = Node::read(&mut reader).unwrap();
|
||||||
assert_eq!(meta.mode() & 0o777, node.mode as u32);
|
assert_eq!(meta.mode() & 0o777, node.mode as u32);
|
||||||
|
Loading…
Reference in New Issue
Block a user