Example #1
0
    def test_DCH_DoesNothingOutsideTopBottomMargin(self):
        """DCH should do nothing outside top-bottom margins."""
        escio.Write("abcde")
        esccmd.DECSTBM(2, 3)
        esccmd.CUP(Point(1, 1))
        esccmd.DCH(99)
        esccmd.DECSTBM()

        AssertScreenCharsInRectEqual(Rect(1, 1, 5, 1), ["abcde"])
Example #2
0
  def test_DCH_WorksOutsideTopBottomMargin(self):
    """Per Thomas Dickey, DCH should work outside scrolling margin (see xterm
    changelog for patch 316)."""
    escio.Write("abcde")
    esccmd.DECSTBM(2, 3)
    esccmd.CUP(Point(1, 1))
    esccmd.DCH(99)
    esccmd.DECSTBM()

    AssertScreenCharsInRectEqual(Rect(1, 1, 5, 1), [ NUL * 5 ])
Example #3
0
  def test_DCH_DoesNothingOutsideLeftRightMargin(self):
    """DCH should do nothing outside left-right margins."""
    escio.Write("abcde")
    esccmd.DECSET(esccmd.DECLRMM)
    esccmd.DECSLRM(2, 4)
    esccmd.CUP(Point(1, 1))
    esccmd.DCH(99)
    esccmd.DECRESET(esccmd.DECLRMM)

    AssertScreenCharsInRectEqual(Rect(1, 1, 5, 1), [ "abcde" ])
Example #4
0
  def test_DCH_DeleteAllWithMargins(self):
    """Delete all characters up to right margin."""
    escio.Write("abcde")
    esccmd.DECSET(esccmd.DECLRMM)
    esccmd.DECSLRM(2, 4)
    esccmd.CUP(Point(3, 1))
    esccmd.DCH(99)
    esccmd.DECRESET(esccmd.DECLRMM)

    AssertScreenCharsInRectEqual(Rect(1, 1, 5, 1), [ "ab" + NUL * 2 + "e" ]);
Example #5
0
  def test_DCH_RespectsMargins(self):
    """DCH respects left-right margins."""
    escio.Write("abcde")
    esccmd.DECSET(esccmd.DECLRMM)
    esccmd.DECSLRM(2, 4)
    esccmd.CUP(Point(3, 1))
    esccmd.DCH()
    esccmd.DECRESET(esccmd.DECLRMM)

    AssertScreenCharsInRectEqual(Rect(1, 1, 5, 1), [ "abd" + NUL + "e" ]);
Example #6
0
 def test_DCH_DefaultParam(self):
   """DCH with no parameter should delete one character at the cursor."""
   escio.Write("abcd")
   esccmd.CUP(Point(2, 1))
   esccmd.DCH()
   AssertScreenCharsInRectEqual(Rect(1, 1, 4, 1), [ "acd" + NUL ]);
Example #7
0
 def test_DCH_ExplicitParam(self):
   """DCH deletes the specified number of parameters."""
   escio.Write("abcd")
   esccmd.CUP(Point(2, 1))
   esccmd.DCH(2)
   AssertScreenCharsInRectEqual(Rect(1, 1, 4, 1), [ "ad" + NUL * 2 ]);