fill3: Correctly limit scroll of portals
This commit is contained in:
parent
d192674236
commit
87515dd44f
2 changed files with 24 additions and 14 deletions
|
|
@ -47,13 +47,17 @@ class WidgetTests(unittest.TestCase):
|
|||
self.assert_string(portal.appearance_for((2, 1)), "r ")
|
||||
# limit scroll
|
||||
portal.position = (0, 0)
|
||||
self.assertEqual(portal.limit_scroll((1, 1), (1, 1)), (0, 0))
|
||||
portal.limit_scroll((1, 1), (1, 1))
|
||||
self.assertEqual(portal.position, (0, 0))
|
||||
portal.position = (-1, 0)
|
||||
self.assertEqual(portal.limit_scroll((1, 1), (1, 1)), (0, 0))
|
||||
portal.limit_scroll((1, 1), (1, 1))
|
||||
self.assertEqual(portal.position, (0, 0))
|
||||
portal.position = (1, 0)
|
||||
self.assertEqual(portal.limit_scroll((6, 1), (1, 1)), (0, 0))
|
||||
portal.limit_scroll((6, 1), (1, 1))
|
||||
self.assertEqual(portal.position, (0, 0))
|
||||
portal.is_left_aligned = False
|
||||
self.assertEqual(portal.limit_scroll((6, 1), (1, 1)), (-5, 0))
|
||||
portal.limit_scroll((6, 1), (1, 1))
|
||||
self.assertEqual(portal.position, (-5, 0))
|
||||
|
||||
def test_border_widget(self):
|
||||
contents = fill3.Filler(self.TEXT_A)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue