mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
Fix failing test with unicode-lines feature (#3455)
This commit is contained in:
parent
6618cf2d68
commit
d6e4fd15fc
@ -305,8 +305,17 @@ fn get_line_ending_str() {
|
||||
fn line_end_char_index_rope_slice() {
|
||||
let r = Rope::from_str("Hello\rworld\nhow\r\nare you?");
|
||||
let s = &r.slice(..);
|
||||
assert_eq!(line_end_char_index(s, 0), 11);
|
||||
assert_eq!(line_end_char_index(s, 1), 15);
|
||||
assert_eq!(line_end_char_index(s, 2), 25);
|
||||
#[cfg(not(feature = "unicode-lines"))]
|
||||
{
|
||||
assert_eq!(line_end_char_index(s, 0), 11);
|
||||
assert_eq!(line_end_char_index(s, 1), 15);
|
||||
assert_eq!(line_end_char_index(s, 2), 25);
|
||||
}
|
||||
#[cfg(feature = "unicode-lines")]
|
||||
{
|
||||
assert_eq!(line_end_char_index(s, 0), 5);
|
||||
assert_eq!(line_end_char_index(s, 1), 11);
|
||||
assert_eq!(line_end_char_index(s, 2), 15);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user