Tests for Cursor

This commit is contained in:
Kovid Goyal
2016-10-16 20:47:00 +05:30
parent adaf748852
commit b9c15ef8e3
2 changed files with 24 additions and 1 deletions
+12
View File
@@ -40,8 +40,20 @@ class Cursor:
ans.hidden = self.hidden
ans.fg, ans.bg, ans.decoration_fg = self.fg, self.bg, self.decoration_fg
ans.bold, ans.italic, ans.reverse, ans.strikethrough = self.bold, self.italic, self.reverse, self.strikethrough
ans.decoration = self.decoration
return ans
def __eq__(self, other):
if not isinstance(other, Cursor):
return False
for x in self.__slots__:
if getattr(self, x) != getattr(other, x):
return False
return True
def __ne__(self, other):
return not self.__eq__(other)
class Line: