()
| 4 | |
| 5 | |
| 6 | def test_inline_fn(): |
| 7 | assert ( |
| 8 | sanitize( |
| 9 | """\ |
| 10 | def f(n): |
| 11 | def factorial(i): |
| 12 | if i == 0: |
| 13 | return 1 |
| 14 | else: |
| 15 | return i * factorial(i-1) |
| 16 | |
| 17 | result = [] |
| 18 | for i in range(1, n+1): |
| 19 | if i % 2 == 0: |
| 20 | result.append(factorial(i)) |
| 21 | else: |
| 22 | result.append(sum(range(1, i+1))) |
| 23 | return result |
| 24 | |
| 25 | # Test the function |
| 26 | print(f(5))""", |
| 27 | entry_point="f", |
| 28 | ) |
| 29 | == """\ |
| 30 | def f(n): |
| 31 | def factorial(i): |
| 32 | if i == 0: |
| 33 | return 1 |
| 34 | else: |
| 35 | return i * factorial(i-1) |
| 36 | |
| 37 | result = [] |
| 38 | for i in range(1, n+1): |
| 39 | if i % 2 == 0: |
| 40 | result.append(factorial(i)) |
| 41 | else: |
| 42 | result.append(sum(range(1, i+1))) |
| 43 | return result""" |
| 44 | ) |
nothing calls this directly
no test coverage detected