From 7888aaecde5762e9fc2b7cda94f6f24e7b214d76 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Mon, 26 Sep 2022 19:33:54 +0200 Subject: [PATCH] test: add create_parent_dir_all_test (#1741) --- ethers-solc/src/utils.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ethers-solc/src/utils.rs b/ethers-solc/src/utils.rs index ce3d1c26..deca64de 100644 --- a/ethers-solc/src/utils.rs +++ b/ethers-solc/src/utils.rs @@ -458,9 +458,16 @@ mod tests { collections::HashSet, fs::{create_dir_all, File}, }; - use tempdir; + #[test] + fn can_create_parent_dirs_with_ext() { + let tmp_dir = tempdir("out").unwrap(); + let path = tmp_dir.path().join("IsolationModeMagic.sol/IsolationModeMagic.json"); + create_parent_dir_all(&path).unwrap(); + assert!(path.parent().unwrap().is_dir()); + } + #[test] fn can_determine_local_paths() { assert!(is_local_source_name(&[""], "./local/contract.sol"));