Added a warning when constructing a Matrix without bracket + test modified
[sympy.git] / sympy / core / tests / test_relational.py
blobda7ab816fd3c7d3ac0d3402d88af349daa94feab
1 from sympy import symbols
2 from sympy.core.relational import Relational, Equality, StrictInequality, \
3 Rel, Eq, Lt, Le, Gt, Ge, Ne
5 x,y,z = symbols('xyz')
8 def test_rel_ne():
9 Relational(x, y, '!=') # this used to raise
12 def test_rel_subs():
13 e = Relational(x, y, '==')
14 e = e.subs(x,z)
16 assert isinstance(e, Equality)
17 assert e.lhs == z
18 assert e.rhs == y
20 e = Relational(x, y, '<')
21 e = e.subs(x,z)
23 assert isinstance(e, StrictInequality)
24 assert e.lhs == z
25 assert e.rhs == y
28 def test_wrappers():
29 e = x+x**2
31 res = Relational(y, e, '==')
32 assert Rel(y, x+x**2, '==') == res
33 assert Eq(y, x+x**2) == res
35 res = Relational(y, e, '<')
36 assert Lt(y, x+x**2) == res
38 res = Relational(y, e, '<=')
39 assert Le(y, x+x**2) == res
41 res = Relational(y, e, '>')
42 assert Gt(y, x+x**2) == res
44 res = Relational(y, e, '>=')
45 assert Ge(y, x+x**2) == res
47 res = Relational(y, e, '!=')
48 assert Ne(y, x+x**2) == res