[Zope-Checkins] CVS: Zope3/lib/python/Persistence/BTrees/tests - testSetOps.py:1.4

Tim Peters tim.one@comcast.net
Sun, 23 Jun 2002 15:38:09 -0400


Update of /cvs-repository/Zope3/lib/python/Persistence/BTrees/tests
In directory cvs.zope.org:/tmp/cvs-serv18134/tests

Modified Files:
	testSetOps.py 
Log Message:
The set operation difference(X, None) was returning None instead of
returning X, contradicting the docs and common sense.
difference(None, X) continues to return None.


=== Zope3/lib/python/Persistence/BTrees/tests/testSetOps.py 1.3 => 1.4 ===
             self.assert_(C is None)
 
-        for op in self.union, self.intersection:
+        for op in self.union, self.intersection, self.difference:
             for A in self.As:
                 C = op(A, None)
                 self.assert_(C is A)
 
                 C = op(None, A)
-                self.assert_(C is A)
-
-        # XXX These difference results contradict the docs.  The implementation
-        # XXX is almost certainly wrong, but can we change it?
-        for A in self.As:
-            C = self.difference(A, None)
-            self.assert_(C is None)
-
-            C = self.difference(None, A)
-            self.assert_(C is None)
+                if op is self.difference:
+                    self.assert_(C is None)
+                else:
+                    self.assert_(C is A)
 
     def testEmptyUnion(self):
         for A in self.As: