mirror of
https://github.com/jlengrand/Coding4Interviews.git
synced 2026-03-10 08:11:24 +00:00
Adds collision testing
This commit is contained in:
@@ -41,5 +41,10 @@ class test_hash_map(unittest.TestCase):
|
||||
hm.add("a")
|
||||
self.assertEqual(hm.size(), 1)
|
||||
|
||||
# Tests Collision
|
||||
self.assertRaises(Exception, lambda x : hm.add(a))
|
||||
self.assertEqual(hm.size(), 1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user