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

Function rsync_change_kind

dev-scripts/src/sync/mirror/rsync_changes.rs:274–292  ·  view source on GitHub ↗
(
        #[case] input: &[u8],
        #[case] expected_change_kind: ChangeKind,
        #[case] expected_path_kind: PathKind,
        #[case] changed_name: &[u8],
    )

Source from the content-addressed store, hash-verified

272 )]
273 fn rsync_change_kind(
274 #[case] input: &[u8],
275 #[case] expected_change_kind: ChangeKind,
276 #[case] expected_path_kind: PathKind,
277 #[case] changed_name: &[u8],
278 ) -> TestResult {
279 let Report::PathChange {
280 change_kind,
281 path_kind,
282 path,
283 } = Report::parser(input)?
284 else {
285 panic!("rsync didn't report a change");
286 };
287 assert_eq!(change_kind, expected_change_kind);
288 assert_eq!(path_kind, expected_path_kind);
289 assert_eq!(path.as_os_str().as_bytes(), changed_name);
290 Ok(())
291 }
292
293 #[rstest]
294 #[case::attr_change(b".f+++++++++ file.name")]
295 #[case::changed_remotely(b"<f+++++++++ file.name")]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected