(self)
| 1090 | AA in h |
| 1091 | |
| 1092 | def test_hamt_getitem_1(self): |
| 1093 | A = HashKey(100, 'A') |
| 1094 | AA = HashKey(100, 'A') |
| 1095 | |
| 1096 | B = HashKey(101, 'B') |
| 1097 | |
| 1098 | h = hamt() |
| 1099 | h = h.set(A, 1) |
| 1100 | |
| 1101 | self.assertEqual(h[A], 1) |
| 1102 | self.assertEqual(h[AA], 1) |
| 1103 | |
| 1104 | with self.assertRaises(KeyError): |
| 1105 | h[B] |
| 1106 | |
| 1107 | with self.assertRaises(EqError): |
| 1108 | with HaskKeyCrasher(error_on_eq=True): |
| 1109 | h[AA] |
| 1110 | |
| 1111 | with self.assertRaises(HashingError): |
| 1112 | with HaskKeyCrasher(error_on_hash=True): |
| 1113 | h[AA] |
| 1114 | |
| 1115 | |
| 1116 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected