# -*- coding: iso-8859-1 -*-
from __future__ import division # 1/2 == .5 (par defaut, 1/2 == 0)

import mathlib

from customtest import *
import sympy

# Teste que certains bugs de sympy sont bien ou résolus, ou temporairement patchés


class TestSympy(CustomTest):

    def test_sympy(self):
        oo = sympy.oo
        x = sympy.Symbol('x', real = True)
        self.assert_(-oo < oo)
        self.assert_(not(-1.5 < -oo))
        self.assert_((1-sympy.exp(x)).is_negative is None)
        self.assert_(sympy.Matrix([[1, 2], [3, 4]])**sympy.Integer(2) == sympy.Matrix([[7, 10], [15, 22]]))
        self.assertAlmostEqual(sympy.E._evalf(50), math.e)
        self.assert_(sympy.solve(1/x, x) == [])
        self.assert_(sympy.solve(-(1 + x)/(2 + x)**2 + 1/(2 + x), x) == [])


if __name__ == '__main__':
    unittest.main()
