def test_add_new_symbols_with_values(self): symbolTable = SymbolTable() symbolTable.add_symbol_with_value('first', 16) symbolTable.add_symbol_with_value('second', 17) self.assertEqual(symbolTable.get_symbol_value('first'), 16) self.assertEqual(symbolTable.get_symbol_value('second'), 17)
def test_symbols_collisions(self): symbolTable = SymbolTable() symbolTable.add_symbol_with_value('first', 16) symbolTable.add_symbol_with_value('second', 17) symbolTable.add_symbol('third') self.assertEqual(symbolTable.get_symbol_value('first'), 16) self.assertEqual(symbolTable.get_symbol_value('second'), 17) self.assertEqual(symbolTable.get_symbol_value('third'), 18)