test: add create_parent_dir_all_test (#1741)

This commit is contained in:
Matthias Seitz 2022-09-26 19:33:54 +02:00 committed by GitHub
parent 354fb956a7
commit 7888aaecde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -458,9 +458,16 @@ mod tests {
collections::HashSet, collections::HashSet,
fs::{create_dir_all, File}, fs::{create_dir_all, File},
}; };
use tempdir; 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] #[test]
fn can_determine_local_paths() { fn can_determine_local_paths() {
assert!(is_local_source_name(&[""], "./local/contract.sol")); assert!(is_local_source_name(&[""], "./local/contract.sol"));