aboutsummaryrefslogtreecommitdiff
path: root/app/tests/test_taskview.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/tests/test_taskview.py')
-rw-r--r--app/tests/test_taskview.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/tests/test_taskview.py b/app/tests/test_taskview.py
index 1db708d..78cc2f1 100644
--- a/app/tests/test_taskview.py
+++ b/app/tests/test_taskview.py
@@ -725,6 +725,25 @@ class LanesViewTests(_FakeTui, unittest.TestCase):
pane_w = (screen.width - 3) // 2
self.assertLessEqual(x + len(label) - 1, 1 + pane_w - 2)
+ def test_split_render_truncates_wide_log_lines_to_their_pane(self):
+ # Regression: Japanese characters fill two terminal cells each,
+ # so fitting by character count let transcription results spill
+ # out of the right pane onto the left one.
+ view, screen = self.make_view(self._two_lanes(), width=80)
+ view._ingest_lane_line(view._lanes[1],
+ "[OK] 一号: " + "語" * 40)
+ view.render()
+ found = [(x, t) for _, x, t, _ in screen.strings
+ if t.startswith("[OK] ")]
+ self.assertEqual(len(found), 1)
+ x, line = found[0]
+ self.assertTrue(line.endswith("~"))
+ pane_w = (screen.width - 3) // 2
+ px, pw = 1 + pane_w + 1, (screen.width - 3) - pane_w
+ self.assertGreaterEqual(x, px + 1)
+ self.assertLessEqual(x + taskview.tui._disp_width(line) - 1,
+ px + pw - 2)
+
class SilenceCueTests(_FakeTui, unittest.TestCase):
"""The "(no output 6m)" cue for a running step that stopped emitting."""