def test_power_squared_root(): expr = '9^0.5' parser = ExpressionParser(expr) assert parser.power() == 9**0.5
def test_power_squared_negative(): expr = '-2^2' parser = ExpressionParser(expr) assert parser.power() == (-2)**2
def test_power_power_to_power(): expr = '3^2^3' parser = ExpressionParser(expr) assert parser.power() == 3**2**3
def test_power_squared(): expr = '2^2' parser = ExpressionParser(expr) assert parser.power() == 2**2