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)
def testCanParseSymbolAndOffset(self): parser = cmd_line.AddressParser('.+1') rv = parser.parse() expected = {'ref': '.', 'search_offsets': [], 'offset': 1} self.assertEqual(rv, expected)
def testCanParseSignsOnTheirOwn(self): parser = cmd_line.AddressParser('++') rv = parser.parse() expected = {'ref': '.', 'search_offsets': [], 'offset': 2} self.assertEqual(rv, expected)
def testCanParseOffsetOnItsOwn(self): parser = cmd_line.AddressParser('100') rv = parser.parse() expected = {'ref': None, 'search_offsets': [], 'offset': 100} self.assertEqual(rv, expected)
def testCanParseSymbolAddress_2(self): parser = cmd_line.AddressParser('$') rv = parser.parse() expected = {'ref': '$', 'search_offsets': [], 'offset': None} self.assertEqual(rv, expected)