From: <le...@us...> - 2008-08-10 21:09:46
|
Revision: 5134 http://jython.svn.sourceforge.net/jython/?rev=5134&view=rev Author: leosoto Date: 2008-08-10 21:09:42 +0000 (Sun, 10 Aug 2008) Log Message: ----------- Added test_cmp_jy, with should have tests to ensure CPython compatibility on cmp(). Currently, it only contains test cases for the problems exposed on http://bugs.jython.org/issue1889394 Added Paths: ----------- branches/asm/Lib/test/test_cmp_jy.py Added: branches/asm/Lib/test/test_cmp_jy.py =================================================================== --- branches/asm/Lib/test/test_cmp_jy.py (rev 0) +++ branches/asm/Lib/test/test_cmp_jy.py 2008-08-10 21:09:42 UTC (rev 5134) @@ -0,0 +1,21 @@ +"Tests for cmp() compatibility with CPython" +import unittest +from test import test_support + +class UnicodeDerivedCmp(unittest.TestCase): + "Test for http://bugs.jython.org/issue1889394" + def testCompareWithString(self): + class Test(unicode): + pass + test = Test('{1:1}') + self.assertNotEqual(test, {1:1}) + def testCompareEmptyDerived(self): + class A(unicode): pass + class B(unicode): pass + self.assertEqual(A(), B()) + +def test_main(): + test_support.run_unittest(UnicodeDerivedCmp) + +if __name__ == '__main__': + test_main() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |