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

Function test_forEach

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

Source from the content-addressed store, hash-verified

925
926
927def test_forEach():
928 items = ['Four', 'Three', 'One']
929 result = ['']
930 returnResult = [0]
931 pm.eval("""
932 (returnResult, result, arr) => {
933 returnResult[0] = arr.forEach((element) => result[0] += element);
934 }
935 """)(returnResult, result, items)
936 assert items == ['Four', 'Three', 'One']
937 assert result == ['FourThreeOne']
938 assert returnResult == [None]
939
940
941def test_forEach_check_index():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected