コード例 #1
0
ファイル: decbi.py プロジェクト: unixfreaxjp/Therm
  def test_DECBI_Scrolls(self):
    strings = [ "abcde",
                "fghij",
                "klmno",
                "pqrst",
                "uvwxy" ]
    y = 3
    for s in strings:
      esccmd.CUP(Point(2, y))
      escio.Write(s)
      y += 1

    esccmd.DECSET(esccmd.DECLRMM)
    esccmd.DECSLRM(3, 5)
    esccmd.DECSTBM(4, 6)

    esccmd.CUP(Point(3, 5))
    esccmd.DECBI()

    AssertScreenCharsInRectEqual(Rect(2, 3, 6, 7),
                                 [ "abcde",
                                   "f" + blank() + "ghj",
                                   "k" + blank() + "lmo",
                                   "p" + blank() + "qrt",
                                   "uvwxy" ])
コード例 #2
0
ファイル: decbi.py プロジェクト: unixfreaxjp/Therm
 def test_DECBI_WholeScreenScrolls(self):
   """The spec is confusing and contradictory. It first says "If the cursor is
   at the left margin, then all screen data within the margin moves one column
   to the right" and then says "DECBI is not affected by the margins." I don't
   know what they could mean by the second part."""
   escio.Write("x")
   esccmd.CUP(Point(1, 1))
   esccmd.DECBI()
   AssertScreenCharsInRectEqual(Rect(1, 1, 2, 1), [ blank() + "x" ])
コード例 #3
0
    def test_DECBI_LeftOfMargin(self):
        """Test DECBI (back-index) when the cursor is before the left-margin.

    DEC STD 070 says DECBI can move when outside the margins."""
        esccmd.DECSET(esccmd.DECLRMM)
        esccmd.DECSLRM(3, 5)
        esccmd.CUP(Point(2, 1))
        esccmd.DECBI()
        AssertEQ(GetCursorPosition(), Point(1, 1))
コード例 #4
0
    def test_DECBI_WholeScreenScrolls(self):
        """Test DECBI (back-index) when the cursor is before the left-margin, but
    at the left edge of the screen.

    Refer to DEC STD 070, which says if the cursor is outside the margins,
    at the left edge of the page (which xterm equates with its screen),
    the command is ignored."""
        escio.Write("x")
        esccmd.CUP(Point(1, 1))
        esccmd.DECBI()
        AssertScreenCharsInRectEqual(Rect(1, 1, 2, 1), [blank() + "x"])
コード例 #5
0
ファイル: decbi.py プロジェクト: unixfreaxjp/Therm
 def test_DECBI_Basic(self):
   esccmd.CUP(Point(5, 6))
   esccmd.DECBI()
   AssertEQ(GetCursorPosition(), Point(4, 6))
コード例 #6
0
ファイル: decbi.py プロジェクト: unixfreaxjp/Therm
 def test_DECBI_LeftOfMargin(self):
   esccmd.DECSET(esccmd.DECLRMM)
   esccmd.DECSLRM(3, 5)
   esccmd.CUP(Point(2, 1))
   esccmd.DECBI()
   AssertEQ(GetCursorPosition(), Point(1, 1))
コード例 #7
0
ファイル: decbi.py プロジェクト: unixfreaxjp/Therm
 def test_DECBI_NoWrapOnLeftEdge(self):
   esccmd.CUP(Point(1, 2))
   esccmd.DECBI()
   AssertEQ(GetCursorPosition(), Point(1, 2))