diff options
author | A-Walrus | 2022-08-17 01:37:34 +0000 |
---|---|---|
committer | GitHub | 2022-08-17 01:37:34 +0000 |
commit | d6e4fd15fc86eacbd083f29ed5d3669d3b2e7014 (patch) | |
tree | 5ce5409684ba11f09aeeba6f6b02c6d8654c6baf /helix-core | |
parent | 6618cf2d685dbf2255c7357ba90326baba70cb1f (diff) |
Fix failing test with unicode-lines feature (#3455)
Diffstat (limited to 'helix-core')
-rw-r--r-- | helix-core/src/line_ending.rs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/helix-core/src/line_ending.rs b/helix-core/src/line_ending.rs index f0cf3b10..3e8a6cae 100644 --- a/helix-core/src/line_ending.rs +++ b/helix-core/src/line_ending.rs @@ -305,8 +305,17 @@ mod line_ending_tests { 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); + } } } |