当前位置: 首页>>代码示例>>Python>>正文


Python OC_TestNumber.number_isEqualTo_方法代码示例

本文整理汇总了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)))
开发者ID:Joey-Lee,项目名称:pyobjc,代码行数:14,代码来源:test_number_proxy.py

示例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)))
开发者ID:GreatFruitOmsk,项目名称:pyobjc-core,代码行数:15,代码来源:test_number_proxy.py

示例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))
开发者ID:GreatFruitOmsk,项目名称:pyobjc-core,代码行数:20,代码来源:test_number_proxy.py


注:本文中的PyObjCTest.pythonnumber.OC_TestNumber.number_isEqualTo_方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。