From fa9a91b59e4dee7e289c9711b86525016491e414 Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Tue, 6 Apr 2010 17:02:13 -0300 Subject: QStrign uses the same hash function of str/unicode objects. --- tests/qtcore/qstring_test.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/qtcore') diff --git a/tests/qtcore/qstring_test.py b/tests/qtcore/qstring_test.py index 9bb68a3ed..3f0fb4931 100644 --- a/tests/qtcore/qstring_test.py +++ b/tests/qtcore/qstring_test.py @@ -183,5 +183,10 @@ class QStringImplicitConvertion(unittest.TestCase): obj.setObjectName(QByteArray('foobar')) self.assertEqual(obj.objectName(), QString('foobar')) +class QStringHash(unittest.TestCase): + def testHash(self): + self.assertEqual(hash("key"), hash(QString("key"))) + self.assertEqual(hash(u"aéióu"), hash(QString(u"aéióu"))) + if __name__ == '__main__': unittest.main() -- cgit v1.2.3