]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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 staticmethod_ext import * | |
6 | ||
7 | >>> class X1(X): | |
8 | ... pass | |
9 | ||
10 | ||
11 | >>> x = X(16) | |
12 | >>> x1 = X1(17) | |
13 | ||
14 | ||
15 | ||
16 | >>> x1.count() | |
17 | 2 | |
18 | ||
19 | >>> x.count() | |
20 | 2 | |
21 | ||
22 | >>> X1.count() | |
23 | 2 | |
24 | ||
25 | >>> X.count() | |
26 | 2 | |
27 | ||
28 | ||
29 | >>> x1.magic() | |
30 | 7654321 | |
31 | ||
32 | >>> x.magic() | |
33 | 7654321 | |
34 | ||
35 | >>> X1.magic() | |
36 | 7654321 | |
37 | ||
38 | >>> X.magic() | |
39 | 7654321 | |
40 | ||
41 | ||
42 | ''' | |
43 | ||
44 | def run(args = None): | |
45 | import sys | |
46 | import doctest | |
47 | ||
48 | if args is not None: | |
49 | sys.argv = args | |
50 | return doctest.testmod(sys.modules.get(__name__)) | |
51 | ||
52 | if __name__ == '__main__': | |
53 | print("running...") | |
54 | import sys | |
55 | status = run()[0] | |
56 | if (status == 0): print("Done.") | |
57 | sys.exit(status) |