(self)
| 70 | self.assertEqual(res.strip().splitlines(), ['begin', 'done']) |
| 71 | |
| 72 | def test_multiline(self): |
| 73 | bash = replwrap.bash() |
| 74 | res = bash.run_command("echo '1 2\n3 4'") |
| 75 | self.assertEqual(res.strip().splitlines(), ['1 2', '3 4']) |
| 76 | |
| 77 | # Should raise ValueError if input is incomplete |
| 78 | try: |
| 79 | bash.run_command("echo '5 6") |
| 80 | except ValueError: |
| 81 | pass |
| 82 | else: |
| 83 | assert False, "Didn't raise ValueError for incomplete input" |
| 84 | |
| 85 | # Check that the REPL was reset (SIGINT) after the incomplete input |
| 86 | res = bash.run_command("echo '1 2\n3 4'") |
| 87 | self.assertEqual(res.strip().splitlines(), ['1 2', '3 4']) |
| 88 | |
| 89 | def test_existing_spawn(self): |
| 90 | child = pexpect.spawn("bash", timeout=5, encoding='utf-8') |
nothing calls this directly
no test coverage detected