(self)
| 1303 | AA in h |
| 1304 | |
| 1305 | def test_hamt_getitem_1(self): |
| 1306 | A = HashKey(100, 'A') |
| 1307 | AA = HashKey(100, 'A') |
| 1308 | |
| 1309 | B = HashKey(101, 'B') |
| 1310 | |
| 1311 | h = hamt() |
| 1312 | h = h.set(A, 1) |
| 1313 | |
| 1314 | self.assertEqual(h[A], 1) |
| 1315 | self.assertEqual(h[AA], 1) |
| 1316 | |
| 1317 | with self.assertRaises(KeyError): |
| 1318 | h[B] |
| 1319 | |
| 1320 | with self.assertRaises(EqError): |
| 1321 | with HaskKeyCrasher(error_on_eq=True): |
| 1322 | h[AA] |
| 1323 | |
| 1324 | with self.assertRaises(HashingError): |
| 1325 | with HaskKeyCrasher(error_on_hash=True): |
| 1326 | h[AA] |
| 1327 | |
| 1328 | |
| 1329 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected