Mercurial > lbo > hg > leveldb-rs
changeset 570:6f87d002b918
Fix more tests and remove left-over buggy cfg(unix) directive
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Fri, 08 Jul 2022 14:58:11 -0700 |
parents | 1b8dee163dfe |
children | f7eb588de00d |
files | src/db_impl.rs src/mem_env.rs |
diffstat | 2 files changed, 7 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/db_impl.rs Fri Jul 08 14:09:37 2022 -0700 +++ b/src/db_impl.rs Fri Jul 08 14:58:11 2022 -0700 @@ -1154,21 +1154,21 @@ let e = MemEnv::new(); { let l = Some(share(open_info_log(&e, "abc"))); - assert!(e.exists(Path::new("abc/LOG")).unwrap()); + assert!(e.exists(&Path::new("abc").join("LOG")).unwrap()); log!(l, "hello {}", "world"); - assert_eq!(12, e.size_of(Path::new("abc/LOG")).unwrap()); + assert_eq!(12, e.size_of(&Path::new("abc").join("LOG")).unwrap()); } { let l = Some(share(open_info_log(&e, "abc"))); - assert!(e.exists(Path::new("abc/LOG.old")).unwrap()); - assert!(e.exists(Path::new("abc/LOG")).unwrap()); - assert_eq!(12, e.size_of(Path::new("abc/LOG.old")).unwrap()); - assert_eq!(0, e.size_of(Path::new("abc/LOG")).unwrap()); + assert!(e.exists(&Path::new("abc").join("LOG.old")).unwrap()); + assert!(e.exists(&Path::new("abc").join("LOG")).unwrap()); + assert_eq!(12, e.size_of(&Path::new("abc").join("LOG.old")).unwrap()); + assert_eq!(0, e.size_of(&Path::new("abc").join("LOG")).unwrap()); log!(l, "something else"); log!(l, "and another {}", 1); let mut s = String::new(); - let mut r = e.open_sequential_file(Path::new("abc/LOG")).unwrap(); + let mut r = e.open_sequential_file(&Path::new("abc").join("LOG")).unwrap(); r.read_to_string(&mut s).unwrap(); assert_eq!("something else\nand another 1\n", &s); }
--- a/src/mem_env.rs Fri Jul 08 14:09:37 2022 -0700 +++ b/src/mem_env.rs Fri Jul 08 14:58:11 2022 -0700 @@ -173,7 +173,6 @@ let fs = self.store.lock()?; let mut prefix = path_to_string(p); let main_separator_str = std::path::MAIN_SEPARATOR.to_string(); - #[cfg(unix)] if !prefix.ends_with(&main_separator_str) { prefix.push(std::path::MAIN_SEPARATOR); }