示例#1
0
  def test_DECFI_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(5, 5))
    esccmd.DECFI()

    # It is out of character for xterm to use NUL in the middle of the line,
    # but not terribly important, and not worth marking as a bug. I mentioned
    # it to TED.
    AssertScreenCharsInRectEqual(Rect(2, 3, 6, 7),
                                 [ "abcde",
                                   "fhi" + NUL + "j",
                                   "kmn" + NUL + "o",
                                   "prs" + NUL + "t",
                                   "uvwxy" ])
示例#2
0
 def test_DECFI_RightOfMargin(self):
     """DEC STD 070 says DECFI can move when outside the margins."""
     esccmd.DECSET(esccmd.DECLRMM)
     esccmd.DECSLRM(3, 5)
     esccmd.CUP(Point(6, 1))
     esccmd.DECFI()
     AssertEQ(GetCursorPosition(), Point(7, 1))
示例#3
0
 def test_DECFI_WholeScreenScrolls(self):
     """Starting with the cursor at the right edge of the page (outside the
 margins), verify that DECFI is ignored."""
     size = GetScreenSize()
     esccmd.CUP(Point(size.width(), 1))
     escio.Write("x")
     esccmd.DECFI()
     AssertScreenCharsInRectEqual(
         Rect(size.width() - 1, 1, size.width(), 1), ["x" + empty()])
示例#4
0
 def test_DECFI_WholeScreenScrolls(self):
   """The spec is confusing and contradictory. It first says "If the cursor is
   at the right margin, then all screen data within the margin moves one column
   to the left" and then says "DECFI is not affected by the margins." I don't
   know what they could mean by the second part."""
   size = GetScreenSize()
   esccmd.CUP(Point(size.width(), 1))
   escio.Write("x")
   esccmd.DECFI()
   AssertScreenCharsInRectEqual(Rect(size.width() - 1, 1, size.width(), 1), [ "x" + NUL ])
示例#5
0
    def test_DECFI_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(5, 5))
        esccmd.DECFI()

        AssertScreenCharsInRectEqual(Rect(2, 3, 6, 7), [
            "abcde", "fhi" + empty() + "j", "kmn" + empty() + "o",
            "prs" + empty() + "t", "uvwxy"
        ])
示例#6
0
 def test_DECFI_Basic(self):
   esccmd.CUP(Point(5, 6))
   esccmd.DECFI()
   AssertEQ(GetCursorPosition(), Point(6, 6))
示例#7
0
 def test_DECFI_RightOfMargin(self):
   esccmd.DECSET(esccmd.DECLRMM)
   esccmd.DECSLRM(3, 5)
   esccmd.CUP(Point(6, 1))
   esccmd.DECFI()
   AssertEQ(GetCursorPosition(), Point(7, 1))
示例#8
0
 def test_DECFI_NoWrapOnRightEdge(self):
   size = GetScreenSize()
   esccmd.CUP(Point(size.width(), 2))
   esccmd.DECFI()
   AssertEQ(GetCursorPosition(), Point(size.width(), 2))