(self)
| 1111 | self.assertEqual(len(h), 0) |
| 1112 | |
| 1113 | def test_hamt_items_1(self): |
| 1114 | A = HashKey(100, 'A') |
| 1115 | B = HashKey(201001, 'B') |
| 1116 | C = HashKey(101001, 'C') |
| 1117 | D = HashKey(103, 'D') |
| 1118 | E = HashKey(104, 'E') |
| 1119 | F = HashKey(110, 'F') |
| 1120 | |
| 1121 | h = hamt() |
| 1122 | h = h.set(A, 'a') |
| 1123 | h = h.set(B, 'b') |
| 1124 | h = h.set(C, 'c') |
| 1125 | h = h.set(D, 'd') |
| 1126 | h = h.set(E, 'e') |
| 1127 | h = h.set(F, 'f') |
| 1128 | |
| 1129 | it = h.items() |
| 1130 | self.assertEqual( |
| 1131 | set(list(it)), |
| 1132 | {(A, 'a'), (B, 'b'), (C, 'c'), (D, 'd'), (E, 'e'), (F, 'f')}) |
| 1133 | |
| 1134 | def test_hamt_items_2(self): |
| 1135 | A = HashKey(100, 'A') |