MCPcopy Index your code
hub / github.com/assert-rs/assert_fs / assert

Function assert

src/assert.rs:143–158  ·  view source on GitHub ↗
(path: &path::Path, pred: I)

Source from the content-addressed store, hash-verified

141
142#[track_caller]
143fn assert<I, P>(path: &path::Path, pred: I)
144where
145 I: IntoPathPredicate<P>,
146 P: predicates_core::Predicate<path::Path>,
147{
148 let pred = pred.into_path();
149 if let Some(case) = pred.find_case(false, path) {
150 let palette = crate::Palette::color();
151 panic!(
152 "Unexpected file, failed {:#}\n{:#}={:#}",
153 case.tree(),
154 palette.key("path"),
155 palette.value(path.display())
156 );
157 }
158}
159
160/// Used by [`PathAssert`] to convert Self into the needed [`predicates_core::Predicate<Path>`].
161///

Callers 1

assertMethod · 0.85

Calls 2

into_pathMethod · 0.80
find_caseMethod · 0.80

Tested by

no test coverage detected