本文整理汇总了Python中PyObjCTest.pythonnumber.OC_TestNumber.number_isEqualTo_方法的典型用法代码示例。如果您正苦于以下问题:Python OC_TestNumber.number_isEqualTo_方法的具体用法?Python OC_TestNumber.number_isEqualTo_怎么用?Python OC_TestNumber.number_isEqualTo_使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyObjCTest.pythonnumber.OC_TestNumber
的用法示例。
在下文中一共展示了OC_TestNumber.number_isEqualTo_方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testNumberEqual
# 需要导入模块: from PyObjCTest.pythonnumber import OC_TestNumber [as 别名]
# 或者: from PyObjCTest.pythonnumber.OC_TestNumber import number_isEqualTo_ [as 别名]
def testNumberEqual(self):
self.assert_(not OC_TestNumber.number_isEqualTo_(0, 1))
self.assert_(not OC_TestNumber.number_isEqualTo_(0, 2**64))
self.assert_(not OC_TestNumber.number_isEqualTo_(0, 42.0))
self.assert_(not OC_TestNumber.number_isEqualTo_(0, -1))
self.assert_(not OC_TestNumber.number_isEqualTo_(0, -2**64))
self.assert_(not OC_TestNumber.number_isEqualTo_(0, -42.0))
self.assert_(OC_TestNumber.number_isEqualTo_(0, 0))
self.assert_(OC_TestNumber.number_isEqualTo_(0, 0.0))
self.assert_(OC_TestNumber.number_isEqualTo_(0, long(0)))
示例2: testNumberEqual
# 需要导入模块: from PyObjCTest.pythonnumber import OC_TestNumber [as 别名]
# 或者: from PyObjCTest.pythonnumber.OC_TestNumber import number_isEqualTo_ [as 别名]
def testNumberEqual(self):
self.assertFalse(OC_TestNumber.number_isEqualTo_(0, 1))
self.assertFalse(OC_TestNumber.number_isEqualTo_(0, 2**64))
self.assertFalse(OC_TestNumber.number_isEqualTo_(0, 42.0))
self.assertFalse(OC_TestNumber.number_isEqualTo_(0, -1))
self.assertFalse(OC_TestNumber.number_isEqualTo_(0, -2**64))
self.assertFalse(OC_TestNumber.number_isEqualTo_(0, -42.0))
self.assertTrue(OC_TestNumber.number_isEqualTo_(0, 0))
self.assertTrue(OC_TestNumber.number_isEqualTo_(0, 0.0))
if sys.version_info[0] == 2:
self.assertTrue(OC_TestNumber.number_isEqualTo_(0, long(0)))
示例3: testMixedEquals
# 需要导入模块: from PyObjCTest.pythonnumber import OC_TestNumber [as 别名]
# 或者: from PyObjCTest.pythonnumber.OC_TestNumber import number_isEqualTo_ [as 别名]
def testMixedEquals(self):
# isEqualToNumber for:
# - python number to nsnumber
# - nsnumber to python number
# For: (bool, int, long, float) vs (char, short, ...)
self.assertTrue(OC_TestNumber.number_isEqualTo_(0, NSNumber.numberWithInt_(0)))
self.assertTrue(OC_TestNumber.number_isEqualTo_(0, NSNumber.numberWithLong_(0)))
self.assertTrue(OC_TestNumber.number_isEqualTo_(0, NSNumber.numberWithFloat_(0)))
self.assertTrue(OC_TestNumber.number_isEqualTo_(NSNumber.numberWithInt_(0), 0))
self.assertTrue(OC_TestNumber.number_isEqualTo_(NSNumber.numberWithLong_(0), 0))
self.assertTrue(OC_TestNumber.number_isEqualTo_(NSNumber.numberWithFloat_(0), 0))
self.assertFalse(OC_TestNumber.number_isEqualTo_(42, NSNumber.numberWithInt_(0)))
self.assertFalse(OC_TestNumber.number_isEqualTo_(42, NSNumber.numberWithLong_(0)))
self.assertFalse(OC_TestNumber.number_isEqualTo_(42, NSNumber.numberWithFloat_(0)))
self.assertFalse(OC_TestNumber.number_isEqualTo_(NSNumber.numberWithInt_(0), 42))
self.assertFalse(OC_TestNumber.number_isEqualTo_(NSNumber.numberWithLong_(0), 42))
self.assertFalse(OC_TestNumber.number_isEqualTo_(NSNumber.numberWithFloat_(0), 42))