diff --git a/pystencils_tests/test_sympyextensions.py b/pystencils_tests/test_sympyextensions.py index b0ddd6967dd855ec28db21a14665e7a2e45220ce..1929cc0666a302de3e10423c40794f219bfa38ae 100644 --- a/pystencils_tests/test_sympyextensions.py +++ b/pystencils_tests/test_sympyextensions.py @@ -177,6 +177,17 @@ def test_count_operations(): ops = count_operations(expr, only_type=None) assert ops['muls'] == 99 + expr = DivFunc(1, sp.UnevaluatedExpr(sp.Mul(*[x]*100, evaluate=False))) + ops = count_operations(expr, only_type=None) + assert ops['divs'] == 1 + assert ops['muls'] == 99 + + expr = DivFunc(y + z, sp.UnevaluatedExpr(sp.Mul(*[x]*100, evaluate=False))) + ops = count_operations(expr, only_type=None) + assert ops['adds'] == 1 + assert ops['divs'] == 1 + assert ops['muls'] == 99 + def test_common_denominator(): x = sympy.symbols('x')