Test that selection works with double width characters.
()
| 26 | |
| 27 | |
| 28 | async 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 | |
| 49 | class _ScrollableSelectApp(App): |
nothing calls this directly
no test coverage detected
searching dependent graphs…