Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-core/src/chars.rs')
| -rw-r--r-- | helix-core/src/chars.rs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/helix-core/src/chars.rs b/helix-core/src/chars.rs index 817bbb86..24133dd3 100644 --- a/helix-core/src/chars.rs +++ b/helix-core/src/chars.rs @@ -1,5 +1,3 @@ -//! Utility functions to categorize a `char`. - use crate::LineEnding; #[derive(Debug, Eq, PartialEq)] @@ -91,14 +89,12 @@ mod test { #[test] fn test_categorize() { - #[cfg(not(feature = "unicode-lines"))] - const EOL_TEST_CASE: &str = "\n"; - #[cfg(feature = "unicode-lines")] - const EOL_TEST_CASE: &str = "\n\u{000B}\u{000C}\u{0085}\u{2028}\u{2029}"; - const WORD_TEST_CASE: &str = "_hello_world_あいうえおー12345678901234567890"; - const PUNCTUATION_TEST_CASE: &str = + const EOL_TEST_CASE: &'static str = "\n\r\u{000B}\u{000C}\u{0085}\u{2028}\u{2029}"; + const WORD_TEST_CASE: &'static str = + "_hello_world_あいうえおー12345678901234567890"; + const PUNCTUATION_TEST_CASE: &'static str = "!\"#$%&\'()*+,-./:;<=>?@[\\]^`{|}~!”#$%&’()*+、。:;<=>?@「」^`{|}~"; - const WHITESPACE_TEST_CASE: &str = " "; + const WHITESPACE_TEST_CASE: &'static str = " "; for ch in EOL_TEST_CASE.chars() { assert_eq!(CharCategory::Eol, categorize_char(ch)); |