mirror of
https://github.com/boostorg/python.git
synced 2026-01-20 16:52:15 +00:00
27 lines
660 B
Python
27 lines
660 B
Python
"""
|
|
>>> from tuple_ext import *
|
|
>>> def printer(*args):
|
|
... for x in args: print x,
|
|
... print
|
|
...
|
|
>>> print convert_to_tuple("this is a test string")
|
|
('t', 'h', 'i', 's', ' ', 'i', 's', ' ', 'a', ' ', 't', 'e', 's', 't', ' ', 's', 't', 'r', 'i', 'n', 'g')
|
|
>>> t1 = convert_to_tuple("this is")
|
|
>>> t2 = (1,2,3,4)
|
|
>>> test_operators(t1,t2,printer)
|
|
('t', 'h', 'i', 's', ' ', 'i', 's', 1, 2, 3, 4)
|
|
"""
|
|
|
|
def run(args = None):
|
|
import sys
|
|
import doctest
|
|
|
|
if args is not None:
|
|
sys.argv = args
|
|
return doctest.testmod(sys.modules.get(__name__))
|
|
|
|
if __name__ == '__main__':
|
|
print "running..."
|
|
import sys
|
|
sys.exit(run()[0])
|