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() |
---|
9 | 2 |
---|
10 | >>> y2 = copy_Y(y) |
---|
11 | >>> x_instances() |
---|
12 | 3 |
---|
13 | >>> z2 = copy_Z(z) |
---|
14 | >>> x_instances() |
---|
15 | 4 |
---|
16 | >>> assert y_identity(y) is y |
---|
17 | >>> y_equality(y, y) |
---|
18 | 1 |
---|
19 | ''' |
---|
20 | |
---|
21 | def 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 | |
---|
29 | if __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.