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>>> print(y_identity.__doc__.splitlines()[1])
21y_identity( (Y)arg1) -> object :
22'''
23
24def run(args = None):
25    import sys
26    import doctest
27
28    if args is not None:
29        sys.argv = args
30    return doctest.testmod(sys.modules.get(__name__))
31
32if __name__ == '__main__':
33    print("running...")
34    import sys
35    status = run()[0]
36    if (status == 0): print("Done.")
37    sys.exit(status)
38