Add comprehensive UTF-8 selector tests (fixes #299) #302
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Added comprehensive unit tests demonstrating that Terminator already properly supports UTF-8 characters in selectors, including Chinese, Japanese, Korean, Arabic, Cyrillic, emoji, and mixed language text.
Changes
terminator/src/tests/utf8_selector_tests.rswith 13 comprehensive teststerminator/src/tests/mod.rsto include the new test moduleTest Results
All 13 tests pass successfully:
test_chinese_characters_in_role_name_selectortest_japanese_characters_in_name_selectortest_korean_characters_in_text_selectortest_emoji_in_selectortest_mixed_language_selectortest_chinese_in_chained_selectortest_arabic_rtl_texttest_cyrillic_characterstest_special_unicode_characterstest_utf8_byte_length_vs_char_lengthtest_nativeid_with_chinesetest_classname_with_unicodetest_contains_with_chineseTechnical Details
The issue #299 raised a concern about
to_string()not supporting UTF-8. However, Rust strings are UTF-8 by default, and all string operations (to_string(), slicing, etc.) correctly preserve Unicode characters. These tests confirm that no code changes are needed - the existing implementation already handles UTF-8 correctly.Example Selectors Tested
Fixes #299
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]