Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/python/test/back_reference.py @ 13

Last change on this file since 13 was 12, checked in by landauf, 17 years ago

added boost

File size: 716 bytes
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 back_reference_ext import *
6>>> y = Y(3)
7>>> z = Z(4)
8>>> x_instances()
92
10>>> y2 = copy_Y(y)
11>>> x_instances()
123
13>>> z2 = copy_Z(z)
14>>> x_instances()
154
16>>> assert y_identity(y) is y
17>>> y_equality(y, y)
181
19'''
20
21def run(args = None):
22    import sys
23    import doctest
24
25    if args is not None:
26        sys.argv = args
27    return doctest.testmod(sys.modules.get(__name__))
28   
29if __name__ == '__main__':
30    print "running..."
31    import sys
32    status = run()[0]
33    if (status == 0): print "Done."
34    sys.exit(status)
Note: See TracBrowser for help on using the repository browser.