aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2022-01-11 06:14:12 +0100
committerStefan Kangas2022-01-11 06:17:59 +0100
commit8db5f82d452797ec4530c959aac3cc2d19dd795a (patch)
treee21e5157ea09a00a4979179aa489b2adf962ccc6
parent99a9b545f09dc78494e62c9dc34c0cdb280b879e (diff)
downloademacs-8db5f82d452797ec4530c959aac3cc2d19dd795a.tar.gz
emacs-8db5f82d452797ec4530c959aac3cc2d19dd795a.zip
; Fix tabulated-list-mode tests after revert
* test/lisp/emacs-lisp/tabulated-list-tests.el (tabulated-list-print, tabulated-list-sort): Fix tests.
-rw-r--r--test/lisp/emacs-lisp/tabulated-list-tests.el59
1 files changed, 37 insertions, 22 deletions
diff --git a/test/lisp/emacs-lisp/tabulated-list-tests.el b/test/lisp/emacs-lisp/tabulated-list-tests.el
index 0074b10170f..3ce4a63f4f0 100644
--- a/test/lisp/emacs-lisp/tabulated-list-tests.el
+++ b/test/lisp/emacs-lisp/tabulated-list-tests.el
@@ -55,28 +55,37 @@
55(ert-deftest tabulated-list-print () 55(ert-deftest tabulated-list-print ()
56 (tabulated-list--test-with-buffer 56 (tabulated-list--test-with-buffer
57 ;; Basic printing. 57 ;; Basic printing.
58 (should (string= (buffer-substring-no-properties (point-min) (point-max)) 58 (should (string-equal
59 " zzzz-game zzzz-game 2113 installed play zzzz in Emacs 59 (buffer-substring-no-properties (point-min) (point-max))
60 4clojure 4clojure 1507 obsolete Open and evaluate 4clojure.com questions 60 "\
61 abc-mode abc-mode 944 available Major mode for editing abc music files 61 zzzz-game zzzz-game 2113 installed play zzzz in Emacs
62 mode mode 1128 installed A simple mode for editing Actionscript 3 files\n")) 62 4clojure 4clojure 1507 obsolete Open and evaluate 4clojure.com questions
63 abc-mode abc-mode 944 available Major mode for editing abc music files
64 mode mode 1128 installed A simple mode for editing Actionscript 3 files
65"))
63 ;; Preserve position. 66 ;; Preserve position.
64 (forward-line 3) 67 (forward-line 3)
65 (let ((pos (thing-at-point 'line))) 68 (let ((pos (thing-at-point 'line)))
66 (pop tabulated-list-entries) 69 (pop tabulated-list-entries)
67 (tabulated-list-print t) 70 (tabulated-list-print t)
68 (should (equal (thing-at-point 'line) pos)) 71 (should (equal (thing-at-point 'line) pos))
69 (should (string= (buffer-substring-no-properties (point-min) (point-max)) 72 (should (string-equal
70 " 4clojure 4clojure 1507 obsolete Open and evaluate 4clojure.com questions 73 (buffer-substring-no-properties (point-min) (point-max))
71 abc-mode abc-mode 944 available Major mode for editing abc music files 74 "\
72 mode mode 1128 installed A simple mode for editing Actionscript 3 files\n")) 75 4clojure 4clojure 1507 obsolete Open and evaluate 4clojure.com questions
76 abc-mode abc-mode 944 available Major mode for editing abc music files
77 mode mode 1128 installed A simple mode for editing Actionscript 3 files
78"))
73 ;; Check the UPDATE argument 79 ;; Check the UPDATE argument
74 (pop tabulated-list-entries) 80 (pop tabulated-list-entries)
75 (setf (cdr (car tabulated-list-entries)) (list ["x" "x" "944" "available" " XX"])) 81 (setf (cdr (car tabulated-list-entries)) (list ["x" "x" "944" "available" " XX"]))
76 (tabulated-list-print t t) 82 (tabulated-list-print t t)
77 (should (string= (buffer-substring-no-properties (point-min) (point-max)) 83 (should (string-equal
78 " x x 944 available XX 84 (buffer-substring-no-properties (point-min) (point-max))
79 mode mode 1128 installed A simple mode for editing Actionscript 3 files\n")) 85 "\
86 x x 944 available XX
87 mode mode 1128 installed A simple mode for editing Actionscript 3 files
88"))
80 (should (equal (thing-at-point 'line) pos))))) 89 (should (equal (thing-at-point 'line) pos)))))
81 90
82(ert-deftest tabulated-list-sort () 91(ert-deftest tabulated-list-sort ()
@@ -86,11 +95,14 @@
86 (skip-chars-forward "[:blank:]") 95 (skip-chars-forward "[:blank:]")
87 (tabulated-list-sort) 96 (tabulated-list-sort)
88 (let ((text (buffer-substring-no-properties (point-min) (point-max)))) 97 (let ((text (buffer-substring-no-properties (point-min) (point-max))))
89 (should (string= text 98 (should (string-equal
90 " 4clojure 4clojure 1507 obsolete Open and evaluate 4clojure.com questions 99 text
91 abc-mode abc-mode 944 available Major mode for editing abc music files 100 "\
92 mode mode 1128 installed A simple mode for editing Actionscript 3 files 101 4clojure 4clojure 1507 obsolete Open and evaluate 4clojure.com questions
93 zzzz-game zzzz-game 2113 installed play zzzz in Emacs\n")) 102 abc-mode abc-mode 944 available Major mode for editing abc music files
103 mode mode 1128 installed A simple mode for editing Actionscript 3 files
104 zzzz-game zzzz-game 2113 installed play zzzz in Emacs
105"))
94 106
95 (skip-chars-forward "^[:blank:]") 107 (skip-chars-forward "^[:blank:]")
96 (skip-chars-forward "[:blank:]") 108 (skip-chars-forward "[:blank:]")
@@ -101,11 +113,14 @@
101 (should (string= text (buffer-substring-no-properties (point-min) (point-max)))) 113 (should (string= text (buffer-substring-no-properties (point-min) (point-max))))
102 ;; Invert. 114 ;; Invert.
103 (tabulated-list-sort 1) 115 (tabulated-list-sort 1)
104 (should (string= (buffer-substring-no-properties (point-min) (point-max)) 116 (should (string-equal
105 " zzzz-game zzzz-game 2113 installed play zzzz in Emacs 117 (buffer-substring-no-properties (point-min) (point-max))
106 mode mode 1128 installed A simple mode for editing Actionscript 3 files 118 "\
107 abc-mode abc-mode 944 available Major mode for editing abc music files 119 zzzz-game zzzz-game 2113 installed play zzzz in Emacs
108 4clojure 4clojure 1507 obsolete Open and evaluate 4clojure.com questions\n")) 120 mode mode 1128 installed A simple mode for editing Actionscript 3 files
121 abc-mode abc-mode 944 available Major mode for editing abc music files
122 4clojure 4clojure 1507 obsolete Open and evaluate 4clojure.com questions
123"))
109 ;; Again 124 ;; Again
110 (tabulated-list-sort 1) 125 (tabulated-list-sort 1)
111 (should (string= text (buffer-substring-no-properties (point-min) (point-max))))) 126 (should (string= text (buffer-substring-no-properties (point-min) (point-max)))))