MCPcopy Index your code
hub / github.com/evalplus/evalplus / test_sanitize_simple

Function test_sanitize_simple

tests/test_treesitter_sanitizer.py:39–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37
38
39def test_sanitize_simple():
40 icode = r"""Following is the code snippet:
41```python
42import numpy as np
43from numpy import sin, cos
44
45def f(x):
46 return np.tan(x)
47
48def g(x):
49 return cos(f(x))
50
51def g(x):
52 return sin(f(x))
53
54def c(x):
55 assert 1==1
56
57assert g(0) == 1
58```
59"""
60 assert (
61 sanitize(icode)
62 == r"""import numpy as np
63from numpy import sin, cos
64def f(x):
65 return np.tan(x)
66def g(x):
67 return cos(f(x))"""
68 )
69
70
71def test_sanitize_class():

Callers

nothing calls this directly

Calls 1

sanitizeFunction · 0.90

Tested by

no test coverage detected