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

Function bytes_differ

atomic-cli/tests/it/shim_census_cb13a_test.rs:78–93  ·  view source on GitHub ↗
(before: &[(String, Vec<u8>)], after: &[(String, Vec<u8>)])

Source from the content-addressed store, hash-verified

76}
77
78fn bytes_differ(before: &[(String, Vec<u8>)], after: &[(String, Vec<u8>)]) -> Vec<String> {
79 let mut differences = Vec::new();
80 for (path, bytes) in before {
81 match after.iter().find(|(other, _)| other == path) {
82 None => differences.push(format!("{path} removed")),
83 Some((_, other)) if other != bytes => differences.push(format!("{path} changed")),
84 Some(_) => {}
85 }
86 }
87 for (path, _) in after {
88 if !before.iter().any(|(other, _)| other == path) {
89 differences.push(format!("{path} added"));
90 }
91 }
92 differences
93}
94
95#[test]
96fn census_reports_classes_read_only_and_clean_state_passes() {

Calls 2

iterMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected