OILS / builtin / bracket_osh_test.py View on Github | oilshell.org

26 lines, 17 significant
1#!/usr/bin/env python2
2from __future__ import print_function
3
4import unittest
5
6from _devbuild.gen.id_kind_asdl import Id
7from core import test_lib
8from builtin import bracket_osh # module under test
9
10
11class BracketTest(unittest.TestCase):
12
13 def testStringWordEmitter(self):
14 # Test
15 argv = '-z X -o -z Y -a -z X'.split()
16 cmd_val = test_lib.MakeBuiltinArgv(argv)
17 e = bracket_osh._StringWordEmitter(cmd_val)
18 while True:
19 w = e.ReadWord(None)
20 print(w)
21 if w.id == Id.Eof_Real:
22 break
23
24
25if __name__ == '__main__':
26 unittest.main()