MCPcopy
hub / github.com/Textualize/textual / test_double_width

Function test_double_width

tests/test_selection.py:28–46  ·  view source on GitHub ↗

Test that selection works with double width characters.

()

Source from the content-addressed store, hash-verified

26
27
28async def test_double_width():
29 """Test that selection works with double width characters."""
30
31 TEXT = """😂❤️👍Select😊🙏😍\nme🔥💯😭😂❤️👍"""
32
33 class TextSelectApp(App):
34 def compose(self) -> ComposeResult:
35 yield Static(TEXT)
36
37 app = TextSelectApp()
38 async with app.run_test() as pilot:
39 await pilot.pause()
40 assert await pilot.mouse_down(offset=(2, 0))
41 await pilot.pause()
42 assert await pilot.mouse_up(offset=(7, 1))
43 selected_text = app.screen.get_selected_text()
44 expected = "❤️👍Select😊🙏😍\nme🔥💯😭😂"
45
46 assert selected_text == expected
47
48
49class _ScrollableSelectApp(App):

Callers

nothing calls this directly

Calls 6

TextSelectAppClass · 0.85
run_testMethod · 0.80
mouse_downMethod · 0.80
mouse_upMethod · 0.80
get_selected_textMethod · 0.80
pauseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…