mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
SF patch #670423: Add missing identity tests to operator.c
This commit is contained in:
parent
18acea7c8e
commit
9543b34006
4 changed files with 49 additions and 3 deletions
|
@ -215,6 +215,17 @@ class OperatorTestCase(unittest.TestCase):
|
|||
def test_bitwise_xor(self):
|
||||
self.failUnless(operator.xor(0xb, 0xc) == 0x7)
|
||||
|
||||
def test_is(self):
|
||||
a = b = 'xyzpdq'
|
||||
c = a[:3] + b[3:]
|
||||
self.failUnless(operator.is_(a, b))
|
||||
self.failIf(operator.is_(a,c))
|
||||
|
||||
def test_is_not(self):
|
||||
a = b = 'xyzpdq'
|
||||
c = a[:3] + b[3:]
|
||||
self.failIf(operator.is_not(a, b))
|
||||
self.failUnless(operator.is_not(a,c))
|
||||
|
||||
def test_main():
|
||||
test_support.run_unittest(OperatorTestCase)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue