Add test for deleting images after they scroll off

This commit is contained in:
Kovid Goyal
2017-10-05 21:14:56 +05:30
parent 240c9b5d8b
commit 259e01e879
2 changed files with 24 additions and 2 deletions

View File

@@ -208,3 +208,19 @@ class TestGraphics(BaseTest):
rect_eq(l[1]['dest_rect'], -1, 1, -1 + dx, 1 - dy)
self.ae(l[0]['group_count'], 1), self.ae(l[1]['group_count'], 1)
self.ae(s.cursor.x, 0), self.ae(s.cursor.y, 1)
def test_gr_scroll(self):
cw, ch = 10, 20
s, dx, dy, put_image, put_ref, layers, rect_eq = put_helpers(self, cw, ch)
put_image(s, 10, 20) # a one cell image at (0, 0)
self.ae(len(layers(s)), 1)
for i in range(s.lines):
s.index()
self.ae(len(layers(s)), 1), self.ae(s.grman.image_count, 1)
s.index()
self.ae(len(layers(s)), 0), self.ae(s.grman.image_count, 1)
for i in range(s.historybuf.ynum - 1):
s.index()
self.ae(s.grman.image_count, 1)
s.index()
self.ae(s.grman.image_count, 0)