[Python-checkins] python/dist/src/Lib/test test_doctest.py, 1.24, 1.25

tim_one at users.sourceforge.net tim_one at users.sourceforge.net
Sun Aug 22 03:47:54 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24857/Lib/test
Modified Files:
	test_doctest.py 
Log Message:
_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.
Index: test_doctest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_doctest.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- test_doctest.py	19 Aug 2004 16:38:57 -0000	1.24
+++ test_doctest.py	22 Aug 2004 01:47:51 -0000	1.25
@@ -785,40 +785,17 @@
 >>> 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:
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /