🎨 Lay out the written ranges' code as rustfmt does
rustfmt splits the long asserts of the written-range tests and drops a blank line at the end of the span join; the check fails on its diff otherwise.
This commit is contained in:
1 parent
a5921b15a9
commit
7ed1dd52df
2 files changed
+18
-5
No files matched your search
@@ -600,7 +600,6 @@ impl Changed {
|
||||
};
|
||||
spans.splice(first..last, [joined]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// Of `bytes`, the parts that lie in `spans`, sorted and apart: each of `bytes` cut to them, in
|
||||
@@ -11243,7 +11242,10 @@ pub(super) mod tests {
|
||||
let spans = [100..200, 300..400];
|
||||
assert_eq!(clip(&spans, &[0..1000]), [100..200, 300..400]);
|
||||
assert_eq!(clip(&spans, &[150..350]), [150..200, 300..350]);
|
||||
assert_eq!(clip(&spans, &[0..100, 200..300, 400..500]), Vec::<Range<u64>>::new());
|
||||
assert_eq!(
|
||||
clip(&spans, &[0..100, 200..300, 400..500]),
|
||||
Vec::<Range<u64>>::new()
|
||||
);
|
||||
assert_eq!(clip(&spans, &[120..130, 390..450]), [120..130, 390..400]);
|
||||
assert_eq!(clip(&[], &[0..1000]), Vec::<Range<u64>>::new());
|
||||
}
|
||||
|
||||
@@ -1531,8 +1531,15 @@ mod tests {
|
||||
"the first shape's KiB alone"
|
||||
);
|
||||
let pages = ram_bytes(&r, 1, length, None);
|
||||
assert!(pages[..1024].iter().all(|&b| b == 0xc3), "the shape's bytes");
|
||||
assert_eq!(pages[1024..], before[1024..], "the rest as the pages held them");
|
||||
assert!(
|
||||
pages[..1024].iter().all(|&b| b == 0xc3),
|
||||
"the shape's bytes"
|
||||
);
|
||||
assert_eq!(
|
||||
pages[1024..],
|
||||
before[1024..],
|
||||
"the rest as the pages held them"
|
||||
);
|
||||
let counts = r.dec.caches().counts();
|
||||
assert_eq!(counts.narrowed, 1);
|
||||
assert_eq!(counts.unwritten_bytes, length - 1024);
|
||||
@@ -1583,7 +1590,11 @@ mod tests {
|
||||
complete_staged(&r);
|
||||
let (back, out) = staged_download(&r, cache, 0x3c);
|
||||
assert_eq!(back, [(first, cache, 0)]);
|
||||
assert_eq!((out[0].1, out[0].2, out[0].3), (0, 0, 1024), "the shape's alone");
|
||||
assert_eq!(
|
||||
(out[0].1, out[0].2, out[0].3),
|
||||
(0, 0, 1024),
|
||||
"the shape's alone"
|
||||
);
|
||||
}
|
||||
|
||||
/// A staged download after a writer that wrote nothing the host copied into the cache's
|
||||
|
||||
Reference in new issue
Block a user