pub fn resource_content_randomize(valid: bool, subdirs: &[&str], file: &str) -> (String, String) {
    let mut source_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
        .join("tests")
        .join("resource")
        .join(if valid { "valid" } else { "invalid" });
    for dir in subdirs {
        source_path = source_path.join(dir);
    }

    if !source_path.exists() {
        create_dir(&source_path).expect(format!("Path not found: {}",
                                                source_path.as_path().display()).as_str());
    }

    let source_path = tempdir_in(source_path.clone())
        .expect(format!("Could not create temp dir: {}",
                        source_path.display()).as_str());
    let source = source_path.path();

    if file.is_empty() {
        (String::from(source.to_string_lossy()), String::from(source.to_string_lossy()))
    } else {
        (String::from(source.to_string_lossy()), String::from(source.join(file).to_string_lossy()))
    }
}
/// Get the path of a file at a given location.
///
/// * `valid` - Whether this is a happy or a sad path. See how test resources are structured.
/// * `subdirs` - Path to directory of resource under test.
/// * `file` - Name of file under test.
///
/// Returns:
/// - The absolute path of the resource, or the directory, as a string.
/// - The absolute path of the random output directory or file, to be deleted after the test.
Get the path of a file at a given location.
`valid` - Whether this is a happy or a sad path. See how test resources are structured.
`subdirs` - Path to directory of resource under test.
`file` - Name of file under test.

The absolute path of the resource, or the directory, as a string.
The absolute path of the random output directory or file, to be deleted after the test.
Get the path of a file at a given location . ` valid ` - Whether this is a happy or a sad path . See how test resources are structured . ` subdirs ` - Path to directory of resource under test . ` file ` - Name of file under test . The absolute path of the resource or the directory as a string . The absolute path of the random output directory or file to be deleted after the test .
pub fn resource_content_randomize(valid: bool, subdirs: &[&str], file: &str) -> (String, String) {
    let mut source_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
        .join("tests")
        .join("resource")
        .join(if valid { "valid" } else { "invalid" });
    for dir in subdirs {
        source_path = source_path.join(dir);
    }
    if !source_path.exists() {
        create_dir(&source_path).expect(format!("Path not found: {}",
                                                source_path.as_path().display()).as_str());
    }
    let source_path = tempdir_in(source_path.clone())
        .expect(format!("Could not create temp dir: {}",
                        source_path.display()).as_str());
    let source = source_path.path();
    if file.is_empty() {
        (String::from(source.to_string_lossy()), String::from(source.to_string_lossy()))
    } else {
        (String::from(source.to_string_lossy()), String::from(source.join(file).to_string_lossy()))
    }
}
pub fn resource_content_randomize ( valid : bool , subdirs : & [ & str ] , file : & str ) -> ( String , String ) { let mut source_path = PathBuf :: from ( env ! ( " " ) ) . join ( " " ) . join ( " " ) . join ( if valid { " " } else { " " } ) ; for dir in subdirs { source_path = source_path . join ( dir ) ; } if ! source_path . exists ( ) { create_dir ( & source_path ) . expect ( format ! ( " " source_path as_path ( ) display ( ) ) . as_str ( ) ) ; } let source_path = tempdir_in ( source_path . clone ( ) ) . expect ( format ! ( " " source_path display ( ) ) . as_str ( ) ) ; let source = source_path . path ( ) ; if file . is_empty ( ) { ( String :: from ( source . to_string_lossy ( ) ) , String :: from ( source . to_string_lossy ( ) ) ) } else { ( String :: from ( source . to_string_lossy ( ) ) , String :: from ( source . join ( file ) . to_string_lossy ( ) ) ) } }
Get the path of a file at a given location.
Get the path of a file at a given location .
valid
bool
subdirs
&[&str]
file
&str