def test_RIS_ResetTabs(self): esccmd.HTS() esccmd.CUF() esccmd.HTS() esccmd.CUF() esccmd.HTS() esccmd.RIS() escio.Write(TAB) AssertEQ(GetCursorPosition(), Point(9, 1))
def test_CUF_DefaultParam(self): """CUF moves the cursor right 1 with no parameter given.""" esccmd.CUP(Point(5, 3)) esccmd.CUF() position = GetCursorPosition() AssertEQ(position.x(), 6) AssertEQ(position.y(), 3)
def test_DECALN_ClearsMargins(self): esccmd.DECSET(esccmd.DECLRMM) esccmd.DECSLRM(2, 3) esccmd.DECSTBM(4, 5) esccmd.DECALN() # Verify we can pass the top margin esccmd.CUP(Point(2, 4)) esccmd.CUU() AssertEQ(GetCursorPosition(), Point(2, 3)) # Verify we can pass the bottom margin esccmd.CUP(Point(2, 5)) esccmd.CUD() AssertEQ(GetCursorPosition(), Point(2, 6)) # Verify we can pass the left margin esccmd.CUP(Point(2, 4)) esccmd.CUB() AssertEQ(GetCursorPosition(), Point(1, 4)) # Verify we can pass the right margin esccmd.CUP(Point(3, 4)) esccmd.CUF() AssertEQ(GetCursorPosition(), Point(4, 4))
def test_CUF_StopsAtRightMarginInScrollRegion(self): """When the cursor starts within the scroll region, CUF moves it right to the right margin but no farther.""" # Set a scroll region. esccmd.DECSET(esccmd.DECLRMM) esccmd.DECSLRM(5, 10) # Position the cursor inside the scroll region esccmd.CUP(Point(7, 3)) # Move it right by a lot width = GetScreenSize().width() esccmd.CUF(width) # Ensure it stopped at the right edge of the screen AssertEQ(GetCursorPosition().x(), 10)
def test_CUF_StopsAtRightEdgeWhenBegunRightOfScrollRegion(self): """When the cursor starts right of the scroll region, CUF moves it right to the edge of the screen.""" # Set a scroll region. esccmd.DECSET(esccmd.DECLRMM) esccmd.DECSLRM(5, 10) # Position the cursor right of the scroll region esccmd.CUP(Point(12, 3)) AssertEQ(GetCursorPosition().x(), 12) # Move it right by a lot width = GetScreenSize().width() esccmd.CUF(width) # Ensure it stopped at the right edge of the screen AssertEQ(GetCursorPosition().x(), width)
def test_RIS_RemoveMargins(self): esccmd.DECSET(esccmd.DECLRMM) esccmd.DECSLRM(3, 5) esccmd.DECSTBM(4, 6) esccmd.RIS() esccmd.CUP(Point(3, 4)) esccmd.CUB() AssertEQ(GetCursorPosition(), Point(2, 4)) esccmd.CUU() AssertEQ(GetCursorPosition(), Point(2, 3)) esccmd.CUP(Point(5, 6)) esccmd.CUF() AssertEQ(GetCursorPosition(), Point(6, 6)) esccmd.CUD() AssertEQ(GetCursorPosition(), Point(6, 7))
def test_CUF_StopsAtRightSide(self): """CUF moves the cursor right, stopping at the last line.""" esccmd.CUP(Point(1, 3)) width = GetScreenSize().width() esccmd.CUF(width) AssertEQ(GetCursorPosition().x(), width)
def test_CUF_ExplicitParam(self): """CUF moves the cursor right by the passed-in number of lines.""" esccmd.CUP(Point(1, 2)) esccmd.CUF(2) AssertEQ(GetCursorPosition().x(), 3)