use std::{fs, path::PathBuf};
#[allow(dead_code)]
pub(crate) fn read_to_string(fixture: &str, json: bool) -> String {
let path = if json {
path_to(&format!("{}.json", fixture))
} else {
path_to(fixture)
};
fs::read_to_string(&path).expect(&format!("Failed reading string from '{}'", fixture))
}
fn path_to(fixture: &str) -> PathBuf {
let mut result = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
result.push(format!("tests/samples/{}", fixture));
result
}