mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
python-3.6.zip added from Github
README.cosmo contains the necessary links.
This commit is contained in:
parent
75fc601ff5
commit
0c4c56ff39
4219 changed files with 1968626 additions and 0 deletions
76
third_party/python/Lib/test/sample_doctest.py
vendored
Normal file
76
third_party/python/Lib/test/sample_doctest.py
vendored
Normal file
|
@ -0,0 +1,76 @@
|
|||
"""This is a sample module that doesn't really test anything all that
|
||||
interesting.
|
||||
|
||||
It simply has a few tests, some of which succeed and some of which fail.
|
||||
|
||||
It's important that the numbers remain constant as another test is
|
||||
testing the running of these tests.
|
||||
|
||||
|
||||
>>> 2+2
|
||||
4
|
||||
"""
|
||||
|
||||
|
||||
def foo():
|
||||
"""
|
||||
|
||||
>>> 2+2
|
||||
5
|
||||
|
||||
>>> 2+2
|
||||
4
|
||||
"""
|
||||
|
||||
def bar():
|
||||
"""
|
||||
|
||||
>>> 2+2
|
||||
4
|
||||
"""
|
||||
|
||||
def test_silly_setup():
|
||||
"""
|
||||
|
||||
>>> import test.test_doctest
|
||||
>>> test.test_doctest.sillySetup
|
||||
True
|
||||
"""
|
||||
|
||||
def w_blank():
|
||||
"""
|
||||
>>> if 1:
|
||||
... print('a')
|
||||
... print()
|
||||
... print('b')
|
||||
a
|
||||
<BLANKLINE>
|
||||
b
|
||||
"""
|
||||
|
||||
x = 1
|
||||
def x_is_one():
|
||||
"""
|
||||
>>> x
|
||||
1
|
||||
"""
|
||||
|
||||
def y_is_one():
|
||||
"""
|
||||
>>> y
|
||||
1
|
||||
"""
|
||||
|
||||
__test__ = {'good': """
|
||||
>>> 42
|
||||
42
|
||||
""",
|
||||
'bad': """
|
||||
>>> 42
|
||||
666
|
||||
""",
|
||||
}
|
||||
|
||||
def test_suite():
|
||||
import doctest
|
||||
return doctest.DocTestSuite()
|
Loading…
Add table
Add a link
Reference in a new issue