MCPcopy Create free account
hub / github.com/archlinux/alpm / validate_file

Function validate_file

alpm-mtree/tests/integration.rs:41–55  ·  view source on GitHub ↗
(#[case] schema: &str)

Source from the content-addressed store, hash-verified

39#[case("1")]
40#[case("2")]
41fn validate_file(#[case] schema: &str) -> TestResult {
42 let tmp_dir = tempfile::tempdir()?;
43 let file_path = tmp_dir.path().join("MTREE-TEST");
44 let mut file = File::create(&file_path)?;
45 file.write_all(VALID_MTREE.as_bytes())?;
46
47 let mut cmd = cargo_bin_cmd!("alpm-mtree");
48 cmd.args(vec!["validate", "--schema", schema]);
49 cmd.arg(file_path.to_string_lossy().to_string());
50
51 // Make sure the command was successful
52 cmd.assert().success();
53
54 Ok(())
55}
56
57/// Validate an invalid MTREE file from stdin for both schema versions.
58#[rstest]

Callers

nothing calls this directly

Calls 4

write_allMethod · 0.80
createFunction · 0.50
joinMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected