Commit 242b80f0 authored by Tim Peters's avatar Tim Peters

Gave _ellipsis_match() an attractive new leading underscore.

parent 23053518
...@@ -390,10 +390,10 @@ class _SpoofOut(StringIO): ...@@ -390,10 +390,10 @@ class _SpoofOut(StringIO):
del self.softspace del self.softspace
# Worst-case linear-time ellipsis matching. # Worst-case linear-time ellipsis matching.
def ellipsis_match(want, got): def _ellipsis_match(want, got):
""" """
Essentially the only subtle case: Essentially the only subtle case:
>>> ellipsis_match('aa...aa', 'aaa') >>> _ellipsis_match('aa...aa', 'aaa')
False False
""" """
if ELLIPSIS_MARKER not in want: if ELLIPSIS_MARKER not in want:
...@@ -426,7 +426,7 @@ def ellipsis_match(want, got): ...@@ -426,7 +426,7 @@ def ellipsis_match(want, got):
if startpos > endpos: if startpos > endpos:
# Exact end matches required more characters than we have, as in # Exact end matches required more characters than we have, as in
# ellipsis_match('aa...aa', 'aaa') # _ellipsis_match('aa...aa', 'aaa')
return False return False
# For the rest, we only need to find the leftmost non-overlapping # For the rest, we only need to find the leftmost non-overlapping
...@@ -1558,7 +1558,7 @@ class OutputChecker: ...@@ -1558,7 +1558,7 @@ class OutputChecker:
# The ELLIPSIS flag says to let the sequence "..." in `want` # The ELLIPSIS flag says to let the sequence "..." in `want`
# match any substring in `got`. # match any substring in `got`.
if optionflags & ELLIPSIS: if optionflags & ELLIPSIS:
if ellipsis_match(want, got): if _ellipsis_match(want, got):
return True return True
# We didn't find any match; return false. # We didn't find any match; return false.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment