aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.lima@openbossa.org>2010-04-06 17:02:13 -0300
committerHugo Parente Lima <hugo.lima@openbossa.org>2010-04-06 19:11:16 -0300
commitfa9a91b59e4dee7e289c9711b86525016491e414 (patch)
tree4a2b814703cd483278f2f992982ddcf8699ab867 /tests
parentfc08b8878113645692f65d84e488de8288fa09b7 (diff)
QStrign uses the same hash function of str/unicode objects.
Diffstat (limited to 'tests')
-rw-r--r--tests/qtcore/qstring_test.py5
1 files changed, 5 insertions, 0 deletions
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()