Author: Mark Pearse <[email protected]>
Branch: SpecialisedTuples
Changeset: r49099:ea39171f067d
Date: 2011-11-06 13:43 +0100
http://bitbucket.org/pypy/pypy/changeset/ea39171f067d/
Log: (mwp) add tests for non-delegated neq and ordering
diff --git a/pypy/objspace/std/test/test_specialisedtupleobject.py
b/pypy/objspace/std/test/test_specialisedtupleobject.py
--- a/pypy/objspace/std/test/test_specialisedtupleobject.py
+++ b/pypy/objspace/std/test/test_specialisedtupleobject.py
@@ -115,6 +115,32 @@
for y in values:
assert ((1,2) == (x,y)) == (1 == x and 2 == y)
+ def test_neq(self):
+ a = self.forbid_delegation((1,2))
+ b = (1,2)
+ assert not a != b
+
+ c = (2,1)
+ assert a != c
+
+ d = (1.0,2.0)
+ assert a != d
+
+ e = ('r','s')
+ assert a != e
+
+ def test_ordering (self):
+ a = self.forbid_delegation((1,2))
+ assert a < (2,2)
+ assert a <= (1,2)
+ assert a >= (1,2)
+ assert a > (0,2)
+
+ assert a < (1,3)
+ assert a <= (1,2)
+ assert a >= (1,2)
+ assert a > (1,1)
+
def test_hash(self):
a = (1,2)
b = (1,2)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit