Skip to content

Commit 887a1b0

Browse files
committed
test: Fix tests that check the *Completions* buffer.
Before this change, tests that check the *Completions* buffer relied on text whose wording has changed across versions. This change checks the buffer in a way that will hopefully not be so version-specific.
1 parent 7cff0e0 commit 887a1b0

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

test/turtles-instance-test.el

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,11 @@
230230
;; Make sure that the short documentation are provided correctly as annotations.
231231
(minibuffer-complete)
232232
(turtles-with-grab-buffer (:buf "*Completions*")
233-
(goto-char (point-min))
234-
(search-forward "possible completions:\n")
235-
(delete-region (point-min) (point))
233+
(goto-char (point-max))
234+
(forward-line -1)
236235
(should (equal (concat "default Emacs instance to run tests on.\n"
237236
"turtles--restart A private test instance to test restart.")
238-
(buffer-string))))
237+
(buffer-substring (point) (point-max)))))
239238

240239
;; Select restart
241240
(execute-kbd-macro "turtles--restart"))))

test/turtles-test.el

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,8 +1096,8 @@
10961096
(minibuffer-complete)
10971097
(minibuffer-complete)
10981098
(turtles-with-grab-buffer (:buf "*Completions*")
1099-
(goto-char (point-min))
1100-
(search-forward "possible completions:\n")
1099+
(goto-char (point-max))
1100+
(forward-line -1)
11011101
(should (equal (concat "copy Display a copy of the instance buffer.\n"
11021102
"embedded Display buffer in the terminal buffer.")
11031103
(buffer-substring (point) (point-max))))
@@ -1145,8 +1145,8 @@
11451145
(minibuffer-complete)
11461146
(minibuffer-complete)
11471147
(turtles-with-grab-buffer (:buf "*Completions*")
1148-
(goto-char (point-min))
1149-
(search-forward "possible completions:\n")
1148+
(goto-char (point-max))
1149+
(forward-line -1)
11501150
(should (equal (concat "lambda-1 My Lambda 1.\n"
11511151
"lambda-2 My Lambda 2.")
11521152
(buffer-substring (point) (point-max)))))

0 commit comments

Comments
 (0)