summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_doctest.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2004-08-22 01:47:51 (GMT)
committerTim Peters <tim.peters@gmail.com>2004-08-22 01:47:51 (GMT)
commite594bee5351d6109ca5e6a7dde45e5ddd08ebe48 (patch)
tree42a6e81719e1b7ddcd260e8785e17e345b490dc4 /Lib/test/test_doctest.py
parent5268c3955ae6c1c2681ba214f5c2e450813913fd (diff)
downloadcpython-e594bee5351d6109ca5e6a7dde45e5ddd08ebe48.zip
cpython-e594bee5351d6109ca5e6a7dde45e5ddd08ebe48.tar.gz
cpython-e594bee5351d6109ca5e6a7dde45e5ddd08ebe48.tar.bz2
_ellipsis_match(): Removed special-casing of "...\n". The semantics
are non-obvious either way because the newline character "is invisible", but it's still there all the same, and it's easier to explain/predict if that reality is left alone.
Diffstat (limited to 'Lib/test/test_doctest.py')
-rw-r--r--Lib/test/test_doctest.py33
1 files changed, 5 insertions, 28 deletions
diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py
index 245a9f4..3c5fa08 100644
--- a/Lib/test/test_doctest.py
+++ b/Lib/test/test_doctest.py
@@ -785,40 +785,17 @@ output to match any substring in the actual output:
>>> doctest.DocTestRunner(verbose=False, optionflags=flags).run(test)
(0, 1)
- ... should also match nothing gracefully (note that a regular-expression
- implementation of ELLIPSIS would take a loooong time to match this one!):
+ ... also matches nothing:
>>> for i in range(100):
- ... print i**2 #doctest: +ELLIPSIS
- 0
- ...
- 1
- ...
- ......
- ...
- 36
- ...
- ...
- ...
- 49
- 64
- .........
- 9801
- ...
+ ... print i**2, #doctest: +ELLIPSIS
+ 0 1...4...9 16 ... 36 49 64 ... 9801
... can be surprising; e.g., this test passes:
>>> for i in range(21): #doctest: +ELLIPSIS
- ... print i
- 0
- 1
- 2
- ...
- 1
- ...
- 2
- ...
- 0
+ ... print i,
+ 0 1 2 ...1...2...0
Examples from the docs: