cargo fmt

This commit is contained in:
aiongg
2026-11-24 20:01:10 +00:00
parent 56e0824f2c
commit 41c744b1b2
4 changed files with 19 additions and 5 deletions
+5 -1
View File
@@ -749,7 +749,11 @@ mod tests {
let mut t = Table { cols: vec![1.0; MAX_CELLS + 5], rows: vec![Row::default(); 3], ..Default::default() };
t.normalize();
assert_eq!((t.cols.len(), t.rows.len()), (MAX_CELLS, 1));
let wide = Table { cols: vec![10.0; 1000], rows: vec![Row { height: 1.0, cells: vec![Cell::new("x"); 1100] }; MAX_CELLS / 1000 + 1], ..Default::default() };
let wide = Table {
cols: vec![10.0; 1000],
rows: vec![Row { height: 1.0, cells: vec![Cell::new("x"); 1100] }; MAX_CELLS / 1000 + 1],
..Default::default()
};
let mut n = wide.clone();
n.normalize();
assert_eq!(wide.normalized(), n);
+8 -1
View File
@@ -504,7 +504,14 @@ proptest! {
fn perms_filler_follows_the_seed() {
let perms = |seed: u8| {
let h = create(
&NewEncryption { algorithm: Algorithm::Aes256, user_password: "user", owner_password: "owner", permissions: -1, encrypt_metadata: true, seed: [seed; 32] },
&NewEncryption {
algorithm: Algorithm::Aes256,
user_password: "user",
owner_password: "owner",
permissions: -1,
encrypt_metadata: true,
seed: [seed; 32],
},
ID,
)
.unwrap();
+2 -2
View File
@@ -29,8 +29,8 @@ fn a_flood_of_long_lines_ends_the_command() {
// 600 lines of 60 KB are more than the 32 MB one command may bring. The gate sends lines that
// are not parsed (the cap counts the text read); nightly sends the lines of a real listing.
let full = craft_testkit::hostile::divisor() == 1;
let server = flood(600, |n| if full { format!("* {n} FETCH (UID {} FLAGS ({pad}))\r\n", n + 1) } else { format!("* OK {pad}\r\n") })
+ "A0001 OK done\r\n";
let server =
flood(600, |n| if full { format!("* {n} FETCH (UID {} FLAGS ({pad}))\r\n", n + 1) } else { format!("* OK {pad}\r\n") }) + "A0001 OK done\r\n";
let mut s = Script::new(server);
let err = opened(&mut s, 1000, 2000).uid_fetch_flags("1:*").unwrap_err();
assert!(matches!(err, ProtoError::Protocol(ref m) if m.to_string().contains("too much")), "{err:?}");
+4 -1
View File
@@ -92,7 +92,10 @@ fn a_menu_taller_than_its_room_scrolls_by_its_strips_and_the_wheel_at_the_width_
assert!(in_view(&fixture, menu, 0) && !in_view(&fixture, menu, ROWS - 1));
let rest_on = |at: Rect| move || vec![pointer::moved(at.center())];
assert!(until_stepped(&mut fixture, 400, STRIP_STEP, rest_on(forward), |f| in_view(f, menu, ROWS - 1)), "resting on the lower strip reaches the last row");
assert!(
until_stepped(&mut fixture, 400, STRIP_STEP, rest_on(forward), |f| in_view(f, menu, ROWS - 1)),
"resting on the lower strip reaches the last row"
);
assert!(!in_view(&fixture, menu, 0));
assert!(until_stepped(&mut fixture, 400, STRIP_STEP, rest_on(back), |f| in_view(f, menu, 0)), "resting on the upper strip reaches the first row");