| 1 | #!/usr/bin/env python2
 | 
| 2 | from __future__ import print_function
 | 
| 3 | 
 | 
| 4 | import unittest
 | 
| 5 | 
 | 
| 6 | from core import pyutil
 | 
| 7 | try:
 | 
| 8 |     from _devbuild.gen.help_meta import TOPICS
 | 
| 9 | except ImportError:
 | 
| 10 |     TOPICS = None  # minimal dev build
 | 
| 11 | 
 | 
| 12 | from builtin import misc_osh  # module under test
 | 
| 13 | 
 | 
| 14 | 
 | 
| 15 | class BuiltinTest(unittest.TestCase):
 | 
| 16 | 
 | 
| 17 |     def testPrintHelp(self):
 | 
| 18 |         # Localization: Optionally  use GNU gettext()?  For help only.  Might be
 | 
| 19 |         # useful in parser error messages too.  Good thing both kinds of code are
 | 
| 20 |         # generated?  Because I don't want to deal with a C toolchain for it.
 | 
| 21 | 
 | 
| 22 |         loader = pyutil.GetResourceLoader()
 | 
| 23 |         errfmt = None
 | 
| 24 |         misc_osh.Help('ysh', loader, TOPICS, errfmt)
 | 
| 25 | 
 | 
| 26 | 
 | 
| 27 | if __name__ == '__main__':
 | 
| 28 |     unittest.main()
 |