(self)
| 19 | self.assertTrue(self.check_syntax(fixed_code), msg=f"\n\nFailed test {i} in {test_type}. Syntax checker found a problem with the output: {fixed_code}") |
| 20 | |
| 21 | def test_basic_cases(self): |
| 22 | test_cases = [ |
| 23 | ("def foo(x)\n pass", "def foo(x):\n pass"), |
| 24 | ("if x > 0\n pass\nelif x < 0\n pass", "if x > 0:\n pass\nelif x < 0:\n pass"), |
| 25 | ("if x > 0\n pass\nelse\n pass", "if x > 0:\n pass\nelse:\n pass"), |
| 26 | ("for i in range(10)\n pass", "for i in range(10):\n pass"), |
| 27 | ("while True\n pass", "while True:\n pass"), |
| 28 | ("with open('file.txt') as f\n pass", "with open('file.txt') as f:\n pass"), |
| 29 | ("class MyClass\n def f():\n pass", "class MyClass:\n def f():\n pass"), |
| 30 | ("print(f\"The area of a circle with radius {radius} is {area:.2f}\")", "print(f\"The area of a circle with radius {radius} is {area:.2f}\")") |
| 31 | ] |
| 32 | |
| 33 | self.run_test_cases(test_cases, "Basic", syntax_check=False) |
| 34 | |
| 35 | def test_single_line(self): |
| 36 | test_cases = [ |
nothing calls this directly
no test coverage detected