mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-26 00:57:26 +00:00
cargo fmt
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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:?}");
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user