Пример #1
0
 def testCanParseBangCommand(self):
     parser = cmd_line.CommandLineParser('!')
     rv = parser.parse_cmd_line()
     expected_range = cmd_line.default_range_info.copy()
     expected = dict(
         range=expected_range,
         commands=[{
             "cmd": "!",
             "args": "",
             "forced": False
         }],
         errors=[],
     )
     self.assertEqual(rv, expected)
Пример #2
0
 def testCanParseCommandWithArgsAndRange(self):
     parser = cmd_line.CommandLineParser('100foo! bar 100')
     rv = parser.parse_cmd_line()
     expected_range = cmd_line.default_range_info.copy()
     expected_range['left_offset'] = 100
     expected_range['text_range'] = '100'
     expected = dict(
         range=expected_range,
         commands=[{
             "cmd": "foo",
             "args": "bar 100",
             "forced": True
         }],
         errors=[],
     )
     self.assertEqual(rv, expected)