MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_hamt_items_2

Method test_hamt_items_2

Lib/test/test_context.py:921–940  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

919 {(A, 'a'), (B, 'b'), (C, 'c'), (D, 'd'), (E, 'e'), (F, 'f')})
920
921 def test_hamt_items_2(self):
922 A = HashKey(100, 'A')
923 B = HashKey(101, 'B')
924 C = HashKey(100100, 'C')
925 D = HashKey(100100, 'D')
926 E = HashKey(100100, 'E')
927 F = HashKey(110, 'F')
928
929 h = hamt()
930 h = h.set(A, 'a')
931 h = h.set(B, 'b')
932 h = h.set(C, 'c')
933 h = h.set(D, 'd')
934 h = h.set(E, 'e')
935 h = h.set(F, 'f')
936
937 it = h.items()
938 self.assertEqual(
939 set(list(it)),
940 {(A, 'a'), (B, 'b'), (C, 'c'), (D, 'd'), (E, 'e'), (F, 'f')})
941
942 def test_hamt_keys_1(self):
943 A = HashKey(100, 'A')

Callers

nothing calls this directly

Calls 6

HashKeyClass · 0.85
setFunction · 0.85
listClass · 0.85
setMethod · 0.45
itemsMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected