Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/python/test/str.py @ 45

Last change on this file since 45 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1.1 KB
Line 
1# Copyright David Abrahams 2004. Distributed under the Boost
2# Software License, Version 1.0. (See accompanying
3# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4"""
5>>> from str_ext import *
6>>> def printer(*args):
7...     for x in args: print x,
8...     print
9...
10>>> work_with_string(printer)
11['this', 'is', 'a', 'demo', 'string']
12['this', 'is', 'a', 'demo string']
13this<->is<->a<->demo<->string
14This is a demo string
15[    this is a demo string     ]
162
17this is a demo string
18this is a demo string
19['this is a demo string']
20this is a demo string
21THIS IS A DEMO STRING
22This Is A Demo String
23find
2410
2510 3 5
2610
2710
28expandtabs
29                tab     demo    !
30        tab demo    !
31              tab    demo   !
32operators
33part1part2
34this is a blabla string
3518
3618
37aaaaaaaaaaaaaaaaaaaaa
38"""
39
40def run(args = None):
41    import sys
42    import doctest
43
44    if args is not None:
45        sys.argv = args
46    return doctest.testmod(sys.modules.get(__name__))
47   
48if __name__ == '__main__':
49    print "running..."
50    import sys
51    status = run()[0]
52    if (status == 0): print "Done."
53    sys.exit(status)
Note: See TracBrowser for help on using the repository browser.