MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / verify

Method verify

atomic-repository/examples/materialize_bench.rs:308–328  ·  view source on GitHub ↗
(&self, view: &str)

Source from the content-addressed store, hash-verified

306 }
307
308 fn verify(&self, view: &str) -> Result<()> {
309 ensure!(
310 self.repo.as_ref().unwrap().current_view() == view,
311 "wrong current view"
312 );
313 for file in &self.golden[view] {
314 let path = self.directory.path().join(&file.path);
315 ensure!(
316 fs::symlink_metadata(&path)?.file_type().is_file(),
317 "wrong kind: {}",
318 file.path
319 );
320 ensure!(
321 fs::read(&path)? == file.content,
322 "wrong bytes: {}",
323 file.path
324 );
325 ensure!(file_mode(&path)? == file.mode, "wrong mode: {}", file.path);
326 }
327 Ok(())
328 }
329}
330
331#[derive(Debug, Serialize)]

Callers 2

newMethod · 0.45
sampleFunction · 0.45

Calls 1

pathMethod · 0.45

Tested by

no test coverage detected