From ed6678ce5f5efc11a9132b5a5f898d319bdba270 Mon Sep 17 00:00:00 2001 From: Luca BRUNO Date: Tue, 11 Oct 2022 09:03:40 +0000 Subject: [PATCH] rust/tests: fix static delta generation testcase --- rust-bindings/tests/repo/generate_static.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rust-bindings/tests/repo/generate_static.rs b/rust-bindings/tests/repo/generate_static.rs index b2f3cd74..297ce95d 100644 --- a/rust-bindings/tests/repo/generate_static.rs +++ b/rust-bindings/tests/repo/generate_static.rs @@ -14,8 +14,10 @@ fn should_generate_static_delta_at() { let delta_path = delta_dir.path().join("static_delta.file"); let path_var = delta_path .to_str() + .map(std::ffi::CString::new) .expect("no valid path") - .as_bytes() + .unwrap() + .as_bytes_with_nul() .to_variant(); let test_repo = TestRepo::new(); @@ -38,5 +40,5 @@ fn should_generate_static_delta_at() { ) .expect("static delta generate"); - assert!(std::fs::File::open(&delta_path).is_err()); + assert!(delta_path.try_exists().unwrap()); }