aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNoam Postavsky2018-06-10 18:47:27 -0400
committerNoam Postavsky2018-06-10 18:47:27 -0400
commit962547791e6ea16b18512e6b933a5317c464da26 (patch)
tree87fc820012905ecdca864ec3722c222a82e331d9 /test
parenteaeb69c59c3df6d33a865356973018b24265d120 (diff)
parent8a1576cc03963138d62c42bd373226e58f9f17c6 (diff)
downloademacs-962547791e6ea16b18512e6b933a5317c464da26.tar.gz
emacs-962547791e6ea16b18512e6b933a5317c464da26.zip
Merge from emacs-26
8a1576cc03 Fix term.el cursor movement at bottom margin (Bug#31690)
Diffstat (limited to 'test')
-rw-r--r--test/lisp/term-tests.el20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/lisp/term-tests.el b/test/lisp/term-tests.el
index 72a9ad1ef74..ebf48d50a84 100644
--- a/test/lisp/term-tests.el
+++ b/test/lisp/term-tests.el
@@ -143,6 +143,26 @@ the first character of the line."
143 (should (equal (term-test-screen-from-input width 12 strs) 143 (should (equal (term-test-screen-from-input width 12 strs)
144 (make-string width ?_))))) 144 (make-string width ?_)))))
145 145
146(ert-deftest term-to-margin ()
147 "Test cursor movement at the scroll margin.
148This is a reduced example from GNU nano's initial screen."
149 (let* ((width 10)
150 (x (make-string width ?x))
151 (y (make-string width ?y)))
152 (should (equal (term-test-screen-from-input
153 width 3
154 `("\e[1;3r" ; Setup 3 line scrolling region.
155 "\e[2;1H" ; Move to 2nd last line.
156 ,x ; Fill with 'x'.
157 "\r\e[1B" ; Next line.
158 ,y)) ; Fill with 'y'.
159 (concat "\n" x "\n" y)))
160 ;; Same idea, but moving upwards.
161 (should (equal (term-test-screen-from-input
162 width 3
163 `("\e[1;3r" "\e[2;1H" ,x "\r\e[1A" ,y))
164 (concat y "\n" x)))))
165
146(provide 'term-tests) 166(provide 'term-tests)
147 167
148;;; term-tests.el ends here 168;;; term-tests.el ends here