Пример #1
0
 def testCanParseSearchOffset(self):
     parser = cmd_line.AddressParser('/foo bar')
     rv = parser.parse()
     expected = {
         'ref': None,
         'search_offsets': [['/', 'foo bar', 0]],
         'offset': None
     }
     self.assertEqual(rv, expected)
Пример #2
0
 def testCanParseSymbolAndOffset(self):
     parser = cmd_line.AddressParser('.+1')
     rv = parser.parse()
     expected = {'ref': '.', 'search_offsets': [], 'offset': 1}
     self.assertEqual(rv, expected)
Пример #3
0
 def testCanParseSignsOnTheirOwn(self):
     parser = cmd_line.AddressParser('++')
     rv = parser.parse()
     expected = {'ref': '.', 'search_offsets': [], 'offset': 2}
     self.assertEqual(rv, expected)
Пример #4
0
 def testCanParseOffsetOnItsOwn(self):
     parser = cmd_line.AddressParser('100')
     rv = parser.parse()
     expected = {'ref': None, 'search_offsets': [], 'offset': 100}
     self.assertEqual(rv, expected)
Пример #5
0
 def testCanParseSymbolAddress_2(self):
     parser = cmd_line.AddressParser('$')
     rv = parser.parse()
     expected = {'ref': '$', 'search_offsets': [], 'offset': None}
     self.assertEqual(rv, expected)