cpython: c4cac5d73e9d (original) (raw)

--- a/Lib/idlelib/IdleHistory.py +++ b/Lib/idlelib/IdleHistory.py @@ -49,7 +49,13 @@ class History: self.text.insert(where, output) def fetch(self, reverse):

+

@@ -64,7 +70,7 @@ class History: else: if self.cyclic: pointer = -1 # will be incremented

@@ -75,7 +81,7 @@ class History: pointer = pointer + 1 if pointer < 0 or pointer >= nhist: self.text.bell()

@@ -106,3 +112,9 @@ class History: self.history.append(source) self.pointer = None self.prefix = None + +if name == "main":

new file mode 100644 --- /dev/null +++ b/Lib/idlelib/idle_test/test_idlehistory.py @@ -0,0 +1,164 @@ +import unittest +from test.support import requires + +import tkinter as tk +from tkinter import Text as tkText +from idlelib.idle_test.mock_tk import Text as mkText +from idlelib.IdleHistory import History +from idlelib.configHandler import idleConf + +line1 = 'a = 7' +line2 = 'b = a' + +class StoreTest(unittest.TestCase):

+

+

+

+

+

+

+ + +class TextWrapper:

+ +class FetchTest(unittest.TestCase):

+

+

+

+

+

+

+

+

+

+

+

+

+ + +if name == 'main':