MCPcopy
hub / github.com/evalplus/evalplus / test_entrypoint_no_chain

Function test_entrypoint_no_chain

tests/test_treesitter_sanitizer.py:176–208  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

174
175
176def test_entrypoint_no_chain():
177 icode = r"""Following is the code snippet:
178```python
179import numpy as np
180from numpy import sin, cos, sum
181
182def f(x):
183 return np.sum(x)
184assert f(1) == 5
185def g(x):
186 return cos(f(x))
187
188def c(x):
189 newObj = h()
190 return x
191
192class h():
193 def hello_world():
194 return 0
195
196
197assert g(0) == 1
198```
199"""
200 assert (
201 sanitize(icode, "g")
202 == r"""import numpy as np
203from numpy import sin, cos, sum
204def f(x):
205 return np.sum(x)
206def g(x):
207 return cos(f(x))"""
208 )
209
210
211def test_entrypoint_variable():

Callers

nothing calls this directly

Calls 1

sanitizeFunction · 0.90

Tested by

no test coverage detected