aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorStefan Monnier2020-09-22 23:55:45 -0400
committerStefan Monnier2020-09-22 23:55:45 -0400
commit83a4e4c2a92aa7bcfc7419469b1153f100fe019f (patch)
treea8a5bd5787853619384da931a5981b82d75c3ec2 /test/src
parent8af6b01d10308d7d90d6cc87dc9416afa654ff3b (diff)
downloademacs-83a4e4c2a92aa7bcfc7419469b1153f100fe019f.tar.gz
emacs-83a4e4c2a92aa7bcfc7419469b1153f100fe019f.zip
test/src/xdisp-tests.el: New file
Diffstat (limited to 'test/src')
-rw-r--r--test/src/xdisp-tests.el52
1 files changed, 52 insertions, 0 deletions
diff --git a/test/src/xdisp-tests.el b/test/src/xdisp-tests.el
new file mode 100644
index 00000000000..3d0d0f58302
--- /dev/null
+++ b/test/src/xdisp-tests.el
@@ -0,0 +1,52 @@
1;;; xdisp-tests.el --- tests for xdisp.c functions -*- lexical-binding: t -*-
2
3;; Copyright (C) 2020 Free Software Foundation, Inc.
4
5;; This file is part of GNU Emacs.
6
7;; GNU Emacs is free software: you can redistribute it and/or modify
8;; it under the terms of the GNU General Public License as published by
9;; the Free Software Foundation, either version 3 of the License, or
10;; (at your option) any later version.
11
12;; GNU Emacs is distributed in the hope that it will be useful,
13;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;; GNU General Public License for more details.
16
17;; You should have received a copy of the GNU General Public License
18;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
19
20;;; Code:
21
22(require 'ert)
23
24(ert-deftest xdisp-tests--minibuffer-resizing () ;; bug#43519
25 ;; FIXME: This test returns success when run in batch but
26 ;; it's only a lucky accident: it also returned success
27 ;; when bug#43519 was not fixed.
28 (should
29 (equal
30 t
31 (catch 'result
32 (minibuffer-with-setup-hook
33 (lambda ()
34 (insert "hello")
35 (let ((ol (make-overlay (point) (point)))
36 (max-mini-window-height 1)
37 (text "askdjfhaklsjdfhlkasjdfhklasdhflkasdhflkajsdhflkashdfkljahsdlfkjahsdlfkjhasldkfhalskdjfhalskdfhlaksdhfklasdhflkasdhflkasdhflkajsdhklajsdgh"))
38 ;; (save-excursion (insert text))
39 ;; (sit-for 2)
40 ;; (delete-region (point) (point-max))
41 (put-text-property 0 1 'cursor t text)
42 (overlay-put ol 'after-string text)
43 (redisplay 'force)
44 (throw 'result
45 ;; Make sure we do the see "hello" text.
46 (prog1 (equal (window-start) (point-min))
47 ;; (list (window-start) (window-end) (window-width))
48 (delete-overlay ol)))))
49 (let ((executing-kbd-macro t)) ;Force real minibuffer in `read-string'.
50 (read-string "toto: ")))))))
51
52;;; xdisp-tests.el ends here