23 lines
549 B
Python
23 lines
549 B
Python
import pytest
|
|
|
|
from fenrirscreenreader.screenDriver.ptyDriver import Terminal
|
|
|
|
|
|
class DummyProcessInput:
|
|
def __init__(self):
|
|
self.data = []
|
|
|
|
def write(self, data):
|
|
self.data.append(data)
|
|
|
|
|
|
@pytest.mark.unit
|
|
def test_csi_sequences_with_intermediate_characters_do_not_render_final_byte():
|
|
terminal = Terminal(10, 3, DummyProcessInput())
|
|
|
|
terminal.feed(b"\x1b[2026$p\x1b[2048$pX")
|
|
screen = terminal.get_screen_content()
|
|
|
|
assert screen["text"].splitlines()[0] == "X "
|
|
assert "p" not in screen["text"]
|