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

Function test_reduceRight

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

Source from the content-addressed store, hash-verified

1513
1514
1515def test_reduceRight():
1516 items = [0, 1, 2, 3, 4]
1517 result = [None]
1518 pm.eval("""
1519 (result, arr) => {
1520 result[0] = arr.reduceRight((accumulator, currentValue, index, array) => accumulator + currentValue);
1521 }
1522 """)(result, items)
1523 assert result[0] == 10
1524
1525
1526def test_reduceRight_with_initial_value():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected