summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libdoctest.tex
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2004-08-22 19:43:28 (GMT)
committerTim Peters <tim.peters@gmail.com>2004-08-22 19:43:28 (GMT)
commitc6cbab0db4a3d3878eabc300c259ed74a5237ff0 (patch)
tree35bdd9a5e0f7d234aaf8d5963af7a02b8bda3bf7 /Doc/lib/libdoctest.tex
parent94607dd5ce69f1226b359b0b92ba93e0899c4d62 (diff)
downloadcpython-c6cbab0db4a3d3878eabc300c259ed74a5237ff0.zip
cpython-c6cbab0db4a3d3878eabc300c259ed74a5237ff0.tar.gz
cpython-c6cbab0db4a3d3878eabc300c259ed74a5237ff0.tar.bz2
Added NDIFF_DIFF option.
Diffstat (limited to 'Doc/lib/libdoctest.tex')
-rw-r--r--Doc/lib/libdoctest.tex12
1 files changed, 11 insertions, 1 deletions
diff --git a/Doc/lib/libdoctest.tex b/Doc/lib/libdoctest.tex
index c0bdf6d..0741aa0 100644
--- a/Doc/lib/libdoctest.tex
+++ b/Doc/lib/libdoctest.tex
@@ -356,6 +356,15 @@ can also be used in doctest directives (see below).
actual outputs will be displayed using a context diff.
\end{datadesc}
+\begin{datadesc}{NDIFF_DIFF}
+ When specified, differences are computed by \code{difflib.Differ},
+ using the same algorithm as the popular \file{ndiff.py} utility.
+ This is the only method that marks differences within lines as
+ well as across lines. For example, if a line of expected output
+ contains digit \code{1} where actual output contains letter \code{l},
+ a line is inserted with a caret marking the mismatching column
+ positions.
+\end{datadesc}
A "doctest directive" is a trailing Python comment on a line of a doctest
example:
@@ -414,7 +423,8 @@ can be useful.
\versionchanged[Constants \constant{DONT_ACCEPT_BLANKLINE},
\constant{NORMALIZE_WHITESPACE}, \constant{ELLIPSIS},
- \constant{UNIFIED_DIFF}, and \constant{CONTEXT_DIFF}
+ \constant{UNIFIED_DIFF}, \constant{CONTEXT_DIFF}, and
+ \constant{NDIFF_DIFF}
were added; by default \code{<BLANKLINE>} in expected output
matches an empty line in actual output; and doctest directives
were added]{2.4}