示例#1
0
 def test_IL_DefaultParam(self):
     """Should insert a single line below the cursor."""
     self.prepare_wide()
     esccmd.IL()
     AssertScreenCharsInRectEqual(
         Rect(1, 1, 5,
              4), ["abcde", "fghij", empty() * 5, "klmno"])
示例#2
0
 def test_IL_ExplicitParam(self):
     """Should insert two lines below the cursor."""
     self.prepare_wide()
     esccmd.IL(2)
     AssertScreenCharsInRectEqual(
         Rect(1, 1, 5, 5),
         ["abcde", "fghij",
          empty() * 5, empty() * 5, "klmno"])
示例#3
0
文件: il.py 项目: unixfreaxjp/Therm
    def test_IL_AboveScrollRegion(self):
        """IL is a no-op outside the scroll region."""
        self.prepare_region()
        esccmd.CUP(Point(1, 1))
        esccmd.IL()

        esccmd.DECRESET(esccmd.DECLRMM)
        esccmd.DECSTBM()

        AssertScreenCharsInRectEqual(Rect(
            1, 1, 5, 5), ["abcde", "fGHIj", "kLMNo", "pQRSt", "uvwxy"])
示例#4
0
文件: il.py 项目: unixfreaxjp/Therm
    def test_IL_RespectsScrollRegion_Over(self):
        """Scroll by more than the available space in a region."""
        self.prepare_region()
        esccmd.IL(99)

        esccmd.DECRESET(esccmd.DECLRMM)
        esccmd.DECSTBM()

        AssertScreenCharsInRectEqual(Rect(1, 1, 5, 5), [
            "abcde", "f" + NUL * 3 + "j", "k" + NUL * 3 + "o",
            "p" + NUL * 3 + "t", "uvwxy"
        ])
示例#5
0
文件: il.py 项目: unixfreaxjp/Therm
    def test_IL_RespectsScrollRegion(self):
        """When IL is invoked while the cursor is within the scroll region, lines
    within the scroll regions hould be scrolled down; lines within should
    remain unaffected."""
        self.prepare_region()
        esccmd.IL()

        esccmd.DECRESET(esccmd.DECLRMM)
        esccmd.DECSTBM()

        AssertScreenCharsInRectEqual(
            Rect(1, 1, 5,
                 5), ["abcde", "f" + NUL * 3 + "j", "kGHIo", "pLMNt", "uvwxy"])
示例#6
0
文件: il.py 项目: unixfreaxjp/Therm
    def test_IL_ScrollsOffBottom(self):
        """Lines should be scrolled off the bottom of the screen."""
        height = GetScreenSize().height()
        for i in xrange(height):
            esccmd.CUP(Point(1, i + 1))
            escio.Write("%04d" % (i + 1))
        esccmd.CUP(Point(1, 2))
        esccmd.IL()

        expected = 1
        for i in xrange(height):
            y = i + 1
            if y == 2:
                AssertScreenCharsInRectEqual(Rect(1, y, 4, y), [NUL * 4])
            else:
                AssertScreenCharsInRectEqual(Rect(1, y, 4, y),
                                             ["%04d" % expected])
                expected += 1