From 129ba1d3f33534fb153f2f217d0e0cf599121d2e Mon Sep 17 00:00:00 2001 From: Axel Viala Date: Mon, 10 Jul 2023 15:33:56 +0200 Subject: [PATCH] Fix hardlink test. --- heed/src/env.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/heed/src/env.rs b/heed/src/env.rs index e2819107..3ba7c9c8 100644 --- a/heed/src/env.rs +++ b/heed/src/env.rs @@ -833,9 +833,8 @@ mod tests { #[test] fn open_env_with_named_path_hardlink_and_no_subdir() { let dir = tempfile::tempdir().unwrap(); - let dir_symlink = tempfile::tempdir().unwrap(); let env_name = dir.path().join("babar.mdb"); - let hardlink_name = dir_symlink.path().join("babar.mdb.link"); + let hardlink_name = dir.path().join("babar.mdb.link"); let mut envbuilder = EnvOpenOptions::new(); unsafe { envbuilder.flag(crate::Flag::NoSubDir) }; @@ -844,7 +843,7 @@ mod tests { .open(&env_name) .unwrap(); - std::os::unix::fs::symlink(&dir.path(), &hardlink_name).unwrap(); + std::fs::hard_link(&env_name, &hardlink_name).unwrap(); let _env = envbuilder .map_size(10 * 1024 * 1024) // 10MB .open(&hardlink_name)