Skip to content

Commit 23ece35

Browse files
author
Justin Baum
committed
Add NAN test cases
1 parent e48d790 commit 23ece35

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

Lib/test/test_doctest.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1315,10 +1315,24 @@ def optionflags(): r"""
13151315
[0, 1, ..., 18, 19]
13161316
13171317
The IGNORE_CASE flag causes the test runner to ignore case when
1318-
matching the expected output to the actual output
1318+
matching the expected output to the actual output,
13191319
>>> print("Hello World") # doctest: +IGNORE_CASE
13201320
hello world
13211321
1322+
It can resolve the issues with POSIX and Windows NAN and other types.
1323+
On Windows this should fail without the flag.
1324+
>>> float("NaN") # doctest: +IGNORE_CASE
1325+
nan
1326+
1327+
On POSIX this should fail.
1328+
>>> float("NaN") # doctest: +IGNORE_CASE
1329+
NaN
1330+
1331+
>>> float("nan") # doctest: +IGNORE_CASE
1332+
nan
1333+
>>> float("nan") # doctest: +IGNORE_CASE
1334+
NaN
1335+
13221336
13231337
The SKIP flag causes an example to be skipped entirely. I.e., the
13241338
example is not run. It can be useful in contexts where doctest

0 commit comments

Comments
 (0)