aboutsummaryrefslogtreecommitdiff
path: root/app/tests/test_runview.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/tests/test_runview.py')
-rw-r--r--app/tests/test_runview.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/tests/test_runview.py b/app/tests/test_runview.py
index 4e3f9fe..6add83f 100644
--- a/app/tests/test_runview.py
+++ b/app/tests/test_runview.py
@@ -277,6 +277,17 @@ class LogAppenderTests(_FakeTui, unittest.TestCase):
self.assertTrue(lines[0].endswith(" - one"))
self.assertTrue(lines[2].endswith(" - three"))
+ def test_carriage_return_progress_splits_into_lines(self):
+ # tqdm/git-style \r-only progress: each segment becomes its own
+ # log line instead of one ever-growing buffered line.
+ path, appender = self._appender()
+ appender.write("pct 0\rpct 1\rpct 2\r")
+ appender.flush()
+ with open(path, encoding="utf-8") as handle:
+ lines = handle.read().splitlines()
+ self.assertEqual(len(lines), 3)
+ self.assertTrue(lines[2].endswith(" - pct 2"))
+
def test_blank_lines_and_empty_path_are_skipped(self):
path, appender = self._appender()
appender.write("\n\n")