Skip to content

gh-130693: Add options of the tkinter.Text.search method: -nolinestop -all -overlap -strictlimits #130848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix test failures due to return type being tcl obj not tuple
  • Loading branch information
sharktide authored Jun 18, 2025
commit 6d18d2f2a143f1aa13c7019e7c7f04e6c721373a
14 changes: 8 additions & 6 deletions Lib/test/test_tkinter/test_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,16 @@ def test_nolinestop(self):

def test_all(self):
result = self.text.search('test', '1.0', 'end', all=True)
self.assertIsInstance(result, tuple)
self.assertGreaterEqual(len(result), 2)
self.assertTrue(all(str(index) for index in result)) # ensure valid index strings

self.assertIsInstance(result, str)
indices = result.split()
self.assertGreaterEqual(len(indices), 2)
self.assertTrue(all(isinstance(i, str) for i in indices))

def test_overlap(self):
result = self.text.search('test', '1.0', 'end', all=True, overlap=True)
self.assertIsInstance(result, tuple)
self.assertGreaterEqual(len(result), 2)
indices = result.split()
self.assertGreaterEqual(len(indices), 2)
self.assertTrue('1.10' in indices)

def test_strictlimits(self):
result = self.text.search('test', '1.0', '1.20', strictlimits=True)
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy