mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #21477: Add htests for Search and Replace dialogs.
Patch by Saimadhav Heblikar.
This commit is contained in:
parent
aa7886dd3f
commit
0a4d13e87e
4 changed files with 73 additions and 15 deletions
|
@ -65,3 +65,25 @@ class SearchDialog(SearchDialogBase):
|
|||
if pat:
|
||||
self.engine.setcookedpat(pat)
|
||||
return self.find_again(text)
|
||||
|
||||
def _search_dialog(parent):
|
||||
root = Tk()
|
||||
root.title("Test SearchDialog")
|
||||
width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
|
||||
root.geometry("+%d+%d"%(x, y + 150))
|
||||
text = Text(root)
|
||||
text.pack()
|
||||
text.insert("insert","This is a sample string.\n"*10)
|
||||
|
||||
def show_find():
|
||||
text.tag_add(SEL, "1.0", END)
|
||||
s = _setup(text)
|
||||
s.open(text)
|
||||
text.tag_remove(SEL, "1.0", END)
|
||||
|
||||
button = Button(root, text="Search", command=show_find)
|
||||
button.pack()
|
||||
|
||||
if __name__ == '__main__':
|
||||
from idlelib.idle_test.htest import run
|
||||
run(_search_dialog)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue