MCPcopy Index your code
hub / github.com/fluentpython/example-code-2e / test_lambda

Function test_lambda

18-with-match/lispy/py3.10/lis_test.py:121–128  ·  view source on GitHub ↗
(std_env: Environment)

Source from the content-addressed store, hash-verified

119
120
121def test_lambda(std_env: Environment) -> None:
122 source = '(lambda (a b) (if (>= a b) a b))'
123 func = evaluate(parse(source), std_env)
124 assert func.parms == ['a', 'b']
125 assert func.body == [['if', ['>=', 'a', 'b'], 'a', 'b']]
126 assert func.env is std_env
127 assert func(1, 2) == 2
128 assert func(3, 2) == 3
129
130
131def test_begin(std_env: Environment) -> None:

Callers

nothing calls this directly

Calls 2

evaluateFunction · 0.90
parseFunction · 0.90

Tested by

no test coverage detected