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

Function fn1

tests/python/test_pythonmonkey_eval.py:320–323  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

318def test_eval_functions_pyfunction_in_closure():
319 # BF-58 https://github.com/Distributive-Network/PythonMonkey/pull/19
320 def fn1():
321 def fn0(n):
322 return n + 100
323 return fn0
324 assert 101.9 == fn1()(1.9)
325 assert 101.9 == pm.eval("(fn1) => { return fn1 }")(fn1())(1.9)
326 assert 101.9 == pm.eval("(fn1, x) => { return fn1()(x) }")(fn1, 1.9)

Calls

no outgoing calls

Tested by

no test coverage detected