return_arg.py 752 B

123456789101112131415161718192021222324252627
  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 return_arg_ext import *
  6. >>> l1=Label()
  7. >>> assert l1 is l1.label("bar")
  8. >>> assert l1 is l1.label("bar").sensitive(0)
  9. >>> assert l1.label("foo").sensitive(0) is l1.sensitive(1).label("bar")
  10. >>> assert return_arg is return_arg(return_arg)
  11. '''
  12. def run(args = None):
  13. import sys
  14. import doctest
  15. if args is not None:
  16. sys.argv = args
  17. return doctest.testmod(sys.modules.get(__name__))
  18. if __name__ == '__main__':
  19. print("running...")
  20. import sys
  21. status = run()[0]
  22. if (status == 0): print("Done.")
  23. sys.exit(status)