Make C1 handling UTF-8 safe
This commit is contained in:
@@ -178,6 +178,13 @@ async def test_update_screen_logs_on_exception(docker_exec_session):
|
||||
assert warn.called
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_update_screen_preserves_utf8_bytes_with_c1_values(docker_exec_session):
|
||||
await docker_exec_session._update_screen("✓ ok\r\n".encode())
|
||||
lines = await docker_exec_session.get_screen_lines()
|
||||
assert "✓ ok" in lines[0]
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_add_to_replay_buffer_trims_old_data(docker_exec_session):
|
||||
first_chunk = b"a" * (REPLAY_BUFFER_SIZE - 1)
|
||||
|
||||
@@ -117,6 +117,13 @@ class TestTerminalSession:
|
||||
assert lines[1] == "Updated Line 2"
|
||||
assert lines[2] == "Line 3"
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_screen_preserves_utf8_bytes_with_c1_values(self, terminal_session):
|
||||
"""Ensure UTF-8 bytes containing 0x9c aren't corrupted by C1 normalization."""
|
||||
await terminal_session._update_screen("✓ ok\r\n".encode())
|
||||
lines = await terminal_session.get_screen_lines()
|
||||
assert "✓ ok" in lines[0]
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_screen_state_returns_dirty_flag(self, terminal_session):
|
||||
"""Test that get_screen_state returns has_changes flag based on pyte dirty tracking."""
|
||||
|
||||
Reference in New Issue
Block a user