

def test_operations():
    q = Quantity(10, m)
    p = Quantity(5, s)
    assert ((- q) == Quantity((- 10), m))
    assert (q.add(Quantity(20, m)) == Quantity(30, m))
    assert (p.add(Quantity(20, Unit(m.dim, 10))) == Quantity(30, Unit(m.dim, 11)))
    assert (q.sub(Quantity(20, m)) == Quantity((- 10), m))
    assert (q.sub(Quantity(20, Unit(m.dim, 10))) == Quantity((- 10), Unit(m.dim, (- 9))))
    assert (q.pow(2) == Quantity((10 ** 2), m.pow(2)))
    assert (q.mul(p) == Quantity((5 * 10), m.mul(s)))
    assert (q.div(p) == Quantity((10 / 5), m.div(s)))

dataset/ETHPy150Open sympy/sympy/sympy/physics/unitsystems/tests/test_quantities.py test_operations/VarMisuse@69/71 `q`->`p`