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

Function test_flatMap_no_replace

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

Source from the content-addressed store, hash-verified

2189
2190
2191def test_flatMap_no_replace():
2192 items = [1, 2, [4, 5]]
2193 result = [0]
2194 pm.eval("(result, arr) => {result[0] = arr.flatMap((num) => (num === 2 ? [2, 2] : 1))}")(result, items)
2195 assert items == [1, 2, [4, 5]]
2196 assert result[0] == [1, 2, 2, 1]
2197
2198
2199def test_flatMap_no_replace_depth_one():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected