This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository terminology.
View the commit online.
commit 3b4f7ab28ea0dc295048cf67f4160d865619c2ca
Author: Boris Faure <[email protected]>
AuthorDate: Sat Aug 22 14:36:57 2026 +0200
tests: add backlog_scroll_stress.sh
---
tests/backlog_scroll_stress.sh | 56 ++++++++++++++++++++++++++++++++++++++++++
tests/tests.results | 1 +
2 files changed, 57 insertions(+)
diff --git a/tests/backlog_scroll_stress.sh b/tests/backlog_scroll_stress.sh
new file mode 100755
index 00000000..b8158eda
--- /dev/null
+++ b/tests/backlog_scroll_stress.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+# Push far more content through the screen than the backlog can hold, so that
+# the scrollback ring wraps and old rows are evicted.
+#
+# Most of the suite never scrolls anything off screen, which left the whole
+# save/evict path uncovered. It is also exactly the path a bulk text-append
+# fast path is most likely to break, so it is worth exercising deliberately:
+# long printable runs, runs that wrap at the right margin, rows of differing
+# lengths, and attribute changes that must survive being saved and read back.
+
+# Known state.
+printf '\033c'
+
+# Backlog is 50 rows in the test harness; 120 lines guarantees eviction.
+i=1
+while [ $i -le 120 ]; do
+ # Vary the colour so saved rows are not all attribute-identical.
+ printf '\033[3%d;4%dm' $((i % 8)) $(((i / 8) % 8))
+
+ case $((i % 4)) in
+ 0)
+ # Short line: leaves the tail of the row untouched.
+ printf 'row %d\n' $i
+ ;;
+ 1)
+ # Long line: overruns 80 columns and must autowrap.
+ printf 'row %d ' $i
+ j=0
+ while [ $j -le 12 ]; do
+ printf 'abcdefghi'
+ j=$((j + 1))
+ done
+ printf '\n'
+ ;;
+ 2)
+ # Exactly-at-margin content, to catch off-by-one wrapping.
+ printf 'row %d ' $i
+ printf '%s' 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
+ printf '\n'
+ ;;
+ 3)
+ # Wide characters and a combining mark: the lead cell carries the
+ # codepoint with dblwidth set and the trailing cell must follow it into
+ # the backlog intact.
+ printf 'row %d 漢字テスト e\314\201 done\n' $i
+ ;;
+ esac
+ i=$((i + 1))
+done
+
+printf '\033[0m'
+
+# Scroll a little more with explicit SU/SD so the ring is left mid-rotation
+# rather than neatly aligned.
+printf '\033[5S'
+printf '\033[2T'
diff --git a/tests/tests.results b/tests/tests.results
index a4950901..7dc225c0 100644
--- a/tests/tests.results
+++ b/tests/tests.results
@@ -154,3 +154,4 @@ xterm-set-cursor-color.sh 014a0027499b74ab705575c08005f438
csi-38-no-value.sh 70a432233cdbeeffb383c51be47979d4
osc_selection.sh ee9d9efb1f820ffd54de9465a9a90221
lf_below_bottom_margin.sh 50502caece08a0c9b50d8c6a439a6fce
+backlog_scroll_stress.sh 13a8e9401817e5aacaaad3442b66765e
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.