pub fn snapshot_path(dir: &Path, module_path: &str, name: &str) -> PathBufExpand description
The path of the snapshot file for module_path and name under dir.
The file name is <module-path>__<name>.snap, with both components
sanitized: :: segment separators in a module path collapse to __, and
any other character that is not alphanumeric, _, or - becomes _.
use std::path::{Path, PathBuf};
use test_better_core::TestResult;
use test_better_matchers::{eq, check};
use test_better_snapshot::snapshot_path;
let path = snapshot_path(Path::new("tests/snapshots"), "my_crate::ui", "homepage");
check!(path).satisfies(eq(PathBuf::from("tests/snapshots/my_crate__ui__homepage.snap")))?;