MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / test_keys_iterator

Function test_keys_iterator

tests/python/test_arrays.py:2446–2459  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2444
2445
2446def test_keys_iterator():
2447 items = ['a', 'b', 'c']
2448 result = [7, 8, 9]
2449 pm.eval("""
2450 (result, arr) => {
2451 index = 0;
2452 iterator = arr.keys();
2453 for (const key of iterator) {
2454 result[index] = key;
2455 index++;
2456 }
2457 }
2458 """)(result, items)
2459 assert result == [0, 1, 2]
2460
2461# values
2462

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected