| 48 | self.assertEqual(result.stdout, "From stdin\nSecond line\n") |
| 49 | |
| 50 | def test_dash_reads_stdin_between_files(self): |
| 51 | with tempfile.TemporaryDirectory() as temp_dir: |
| 52 | first = Path(temp_dir) / "first.txt" |
| 53 | second = Path(temp_dir) / "second.txt" |
| 54 | first.write_text("Before\n", encoding="utf-8") |
| 55 | second.write_text("After\n", encoding="utf-8") |
| 56 | |
| 57 | result = self.run_cat(first, "-", second, input_text="Middle\n") |
| 58 | |
| 59 | self.assertEqual(result.returncode, 0) |
| 60 | self.assertEqual(result.stdout, "Before\nMiddle\nAfter\n") |
| 61 | |
| 62 | def test_missing_file_reports_error_and_continues(self): |
| 63 | with tempfile.TemporaryDirectory() as temp_dir: |