    def test_find_min_start(self):
        """
        Check _find_min_start works as expected.
        """
        # Normal operation will find last <limit> characters.
        self.assertEqual(_find_min_start("ABCDEF", 3), 3)

        # Allow extra space for cursor loses another
        self.assertEqual(_find_min_start("ABCDEF", 3, at_end=True), 4)
Check _find_min_start works as expected.
tests/test_widgets.py