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

Function validate_file

alpm-srcinfo/tests/integration.rs:81–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

79 /// Validate a valid SRCINFO file
80 #[test]
81 fn validate_file() -> TestResult {
82 let tmp_dir = tempfile::tempdir()?;
83 let file_path = tmp_dir.path().join("SRCINFO-TEST");
84 let mut file = File::create(&file_path)?;
85 file.write_all(VALID_SRCINFO.as_bytes())?;
86
87 let mut cmd = cargo_bin_cmd!("alpm-srcinfo");
88 cmd.args(vec!["validate"]);
89 cmd.arg(file_path.to_string_lossy().to_string());
90
91 // Make sure the command was successful
92 cmd.assert().success();
93
94 Ok(())
95 }
96
97 /// Validate an invalid SRCINFO file input from stdin
98 #[test]

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