Skip to content

Commit af8809d

Browse files
committed
fmt
1 parent 8142a11 commit af8809d

File tree

3 files changed

+25
-26
lines changed

3 files changed

+25
-26
lines changed

tests/e2e/file_explorer.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,7 @@ fn test_file_explorer_open_file() {
236236
}
237237

238238
// Navigate down to the file (first child after root)
239-
harness
240-
.send_key(KeyCode::Down, KeyModifiers::NONE)
241-
.unwrap();
239+
harness.send_key(KeyCode::Down, KeyModifiers::NONE).unwrap();
242240
harness.render().unwrap();
243241

244242
// Try to open with Enter - should work if we're on a file

tests/e2e/unicode_cursor.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,7 @@ fn test_backspace_utf8_file_save_roundtrip() {
332332
// Verify the file contains only a newline (euro sign fully deleted)
333333
let saved = std::fs::read(&euro_path).unwrap();
334334
assert_eq!(
335-
saved,
336-
b"\n",
335+
saved, b"\n",
337336
"Euro sign should be fully deleted, file should contain only newline. Got: {:?}",
338337
saved
339338
);
@@ -347,9 +346,7 @@ fn test_backspace_utf8_file_save_roundtrip() {
347346
harness2.render().unwrap();
348347

349348
// Move to end of line
350-
harness2
351-
.send_key(KeyCode::End, KeyModifiers::NONE)
352-
.unwrap();
349+
harness2.send_key(KeyCode::End, KeyModifiers::NONE).unwrap();
353350

354351
// Backspace should delete 'å' entirely (2 bytes)
355352
harness2

tests/property_persistence_tests.rs

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ use tempfile::TempDir;
2424
#[derive(Debug, Clone)]
2525
enum BufferOp {
2626
/// Insert bytes at a specific offset
27-
Insert { offset_percent: u8, content: Vec<u8> },
27+
Insert {
28+
offset_percent: u8,
29+
content: Vec<u8>,
30+
},
2831
/// Delete bytes at a specific offset
2932
Delete { offset_percent: u8, len_percent: u8 },
3033
/// Insert at the very start
@@ -66,7 +69,9 @@ impl BufferOp {
6669
let len = if max_len == 0 {
6770
0
6871
} else {
69-
((max_len * (*len_percent as usize)) / 255).max(1).min(max_len)
72+
((max_len * (*len_percent as usize)) / 255)
73+
.max(1)
74+
.min(max_len)
7075
};
7176
if len > 0 && offset < total {
7277
buffer.delete_bytes(offset, len);
@@ -127,7 +132,9 @@ impl BufferOp {
127132
let len = if max_len == 0 {
128133
0
129134
} else {
130-
((max_len * (*len_percent as usize)) / 255).max(1).min(max_len)
135+
((max_len * (*len_percent as usize)) / 255)
136+
.max(1)
137+
.min(max_len)
131138
};
132139
if len > 0 && offset < total {
133140
shadow.drain(offset..offset + len);
@@ -1004,20 +1011,18 @@ fn content_with_crlf_strategy(max_lines: usize) -> impl Strategy<Value = Vec<u8>
10041011
}
10051012

10061013
fn content_with_lf_strategy(max_lines: usize) -> impl Strategy<Value = Vec<u8>> {
1007-
prop::collection::vec(
1008-
prop::collection::vec(32u8..127u8, 5..30),
1009-
1..=max_lines,
1010-
)
1011-
.prop_map(|lines| {
1012-
let mut result = Vec::new();
1013-
for (i, line) in lines.iter().enumerate() {
1014-
result.extend(line);
1015-
if i < lines.len() - 1 {
1016-
result.push(b'\n'); // LF line endings
1014+
prop::collection::vec(prop::collection::vec(32u8..127u8, 5..30), 1..=max_lines).prop_map(
1015+
|lines| {
1016+
let mut result = Vec::new();
1017+
for (i, line) in lines.iter().enumerate() {
1018+
result.extend(line);
1019+
if i < lines.len() - 1 {
1020+
result.push(b'\n'); // LF line endings
1021+
}
10171022
}
1018-
}
1019-
result
1020-
})
1023+
result
1024+
},
1025+
)
10211026
}
10221027

10231028
fn content_with_mixed_endings_strategy(max_lines: usize) -> impl Strategy<Value = Vec<u8>> {
@@ -1204,8 +1209,7 @@ fn test_crlf_preserved_after_edit() {
12041209

12051210
// Should have CRLF throughout
12061211
assert_eq!(
1207-
saved,
1208-
b"line1\r\ninserted\r\nline2\r\nline3\r\n",
1212+
saved, b"line1\r\ninserted\r\nline2\r\nline3\r\n",
12091213
"CRLF should be preserved"
12101214
);
12111215
}

0 commit comments

Comments
 (0)