__eq__ for Line

This commit is contained in:
Kovid Goyal
2016-11-04 14:56:31 +05:30
parent 8324ec1c2b
commit d324baf979
5 changed files with 44 additions and 20 deletions

View File

@@ -20,6 +20,15 @@ def filled_line_buf(ynum=5, xnum=5, cursor=Cursor()):
return ans
def filled_cursor():
ans = Cursor()
ans.bold = ans.italic = ans.reverse = ans.strikethrough = True
ans.fg = 0x101
ans.bg = 0x201
ans.decoration_fg = 0x301
return ans
class BaseTest(TestCase):
ae = TestCase.assertEqual

View File

@@ -4,7 +4,7 @@
import codecs
from . import BaseTest, filled_line_buf
from . import BaseTest, filled_line_buf, filled_cursor
from kitty.utils import is_simple_string, wcwidth, sanitize_title
from kitty.fast_data_types import LineBuf, Cursor as C
@@ -13,10 +13,10 @@ from kitty.fast_data_types import LineBuf, Cursor as C
class TestDataTypes(BaseTest):
def test_linebuf(self):
old = filled_line_buf(2, 3)
old = filled_line_buf(2, 3, filled_cursor())
new = LineBuf(1, 3)
new.copy_old(old)
self.ae(str(new.line(0)), str(old.line(1)))
self.ae(new.line(0), old.line(1))
def test_line(self):
lb = LineBuf(2, 3)