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

Function test_reduce_float

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

Source from the content-addressed store, hash-verified

1414
1415
1416def test_reduce_float():
1417 items = [1.9, 4.6, 9.3, 16.5]
1418 result = [None]
1419 pm.eval("""
1420 (result, arr) => {
1421 result[0] = arr.reduce((accumulator, currentValue) => accumulator + currentValue, 0);
1422 }
1423 """)(result, items)
1424 assert result[0] == 32.3
1425
1426
1427def test_reduce_string():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected