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

Function validate_wrong_file

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

Source from the content-addressed store, hash-verified

110 /// Validate an invalid SRCINFO
111 #[test]
112 fn validate_wrong_file() -> TestResult {
113 let tmp_dir = tempfile::tempdir()?;
114 let file_path = tmp_dir.path().join("SRCINFO-TEST");
115 let mut file = File::create(&file_path)?;
116 file.write_all(VALID_SRCINFO.as_bytes())?;
117 file.write_all(b"\ngiberish_key=this is a test")?;
118
119 let mut cmd = cargo_bin_cmd!("alpm-srcinfo");
120 cmd.args(vec!["validate"]);
121 cmd.arg(file_path.to_string_lossy().to_string());
122
123 // Make sure the command failed
124 cmd.assert().failure();
125
126 Ok(())
127 }
128}
129
130mod format_packages {

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