aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2012-07-29 03:12:13 +0300
committerJuri Linkov2012-07-29 03:12:13 +0300
commitd8efda90aa36b6bea5cca9bd6765cbb76571d933 (patch)
tree2d84debb2dc347873cdd36c6d6eec349f78fe4fc
parent17711ed9be4253d8e1371f6e771505578725c711 (diff)
downloademacs-d8efda90aa36b6bea5cca9bd6765cbb76571d933.tar.gz
emacs-d8efda90aa36b6bea5cca9bd6765cbb76571d933.zip
* test/automated/occur-tests.el (occur-test-case): Use predefined
buffer name " *test-occur*" instead of a random buffer name.
-rw-r--r--test/ChangeLog5
-rw-r--r--test/automated/occur-tests.el49
2 files changed, 32 insertions, 22 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index db8380cfb27..54030e210ed 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
12012-07-29 Juri Linkov <juri@jurta.org>
2
3 * automated/occur-tests.el (occur-test-case): Use predefined
4 buffer name " *test-occur*" instead of a random buffer name.
5
12012-07-20 Dmitry Gutov <dgutov@yandex.ru> 62012-07-20 Dmitry Gutov <dgutov@yandex.ru>
2 7
3 * automated/ruby-mode-tests.el: New file with one test. 8 * automated/ruby-mode-tests.el: New file with one test.
diff --git a/test/automated/occur-tests.el b/test/automated/occur-tests.el
index eb62688d788..5fe9722d4e7 100644
--- a/test/automated/occur-tests.el
+++ b/test/automated/occur-tests.el
@@ -35,7 +35,7 @@ xd
35xex 35xex
36fx 36fx
37" "\ 37" "\
385 matches for \"x\" in buffer: *temp*<2> 385 matches for \"x\" in buffer: *test-occur*
39 1:xa 39 1:xa
40 3:cx 40 3:cx
41 4:xd 41 4:xd
@@ -52,7 +52,7 @@ a
52a 52a
53a 53a
54" "\ 54" "\
552 matches for \"a^Ja\" in buffer: *temp*<2> 552 matches for \"a^Ja\" in buffer: *test-occur*
56 1:a 56 1:a
57 :a 57 :a
58 3:a 58 3:a
@@ -68,7 +68,7 @@ c
68a 68a
69b 69b
70" "\ 70" "\
712 matches for \"a^Jb\" in buffer: *temp*<2> 712 matches for \"a^Jb\" in buffer: *test-occur*
72 1:a 72 1:a
73 :b 73 :b
74 4:a 74 4:a
@@ -82,7 +82,7 @@ c
82a 82a
83 83
84" "\ 84" "\
852 matches for \"a^J\" in buffer: *temp*<2> 852 matches for \"a^J\" in buffer: *test-occur*
86 1:a 86 1:a
87 : 87 :
88 4:a 88 4:a
@@ -97,7 +97,7 @@ d
97ex 97ex
98fx 98fx
99" "\ 99" "\
1002 matches for \"x^J.x^J\" in buffer: *temp*<2> 1002 matches for \"x^J.x^J\" in buffer: *test-occur*
101 1:ax 101 1:ax
102 :bx 102 :bx
103 :c 103 :c
@@ -116,7 +116,7 @@ f
116g 116g
117hx 117hx
118" "\ 118" "\
1193 matches for \"x\" in buffer: *temp*<2> 1193 matches for \"x\" in buffer: *test-occur*
120 1:ax 120 1:ax
121 :b 121 :b
122------- 122-------
@@ -136,7 +136,7 @@ d
136ex 136ex
137f 137f
138" "\ 138" "\
1392 matches for \"x\" in buffer: *temp*<2> 1392 matches for \"x\" in buffer: *test-occur*
140 :a 140 :a
141 2:bx 141 2:bx
142 :c 142 :c
@@ -159,7 +159,7 @@ i
159j 159j
160kx 160kx
161" "\ 161" "\
1625 matches for \"x\" in buffer: *temp*<2> 1625 matches for \"x\" in buffer: *test-occur*
163 1:ax 163 1:ax
164 2:bx 164 2:bx
165 :c 165 :c
@@ -184,7 +184,7 @@ gx
184h 184h
185i 185i
186" "\ 186" "\
1872 matches for \"x\" in buffer: *temp*<2> 1872 matches for \"x\" in buffer: *test-occur*
188 :a 188 :a
189 :b 189 :b
190 3:cx 190 3:cx
@@ -207,7 +207,7 @@ gx
207h 207h
208 208
209" "\ 209" "\
2102 matches for \"x\" in buffer: *temp*<2> 2102 matches for \"x\" in buffer: *test-occur*
211 : 211 :
212 :b 212 :b
213 3:cx 213 3:cx
@@ -232,7 +232,7 @@ i
232jx 232jx
233kx 233kx
234" "\ 234" "\
2353 matches for \"x^J.x\" in buffer: *temp*<2> 2353 matches for \"x^J.x\" in buffer: *test-occur*
236 1:ax 236 1:ax
237 :bx 237 :bx
238 :c 238 :c
@@ -256,7 +256,7 @@ f
256gx 256gx
257hx 257hx
258" "\ 258" "\
2592 matches for \"x^J.x\" in buffer: *temp*<2> 2592 matches for \"x^J.x\" in buffer: *test-occur*
260 1:ax 260 1:ax
261 :bx 261 :bx
262 :c 262 :c
@@ -279,7 +279,7 @@ g
279h 279h
280ix 280ix
281" "\ 281" "\
2823 matches for \"x\" in buffer: *temp*<2> 2823 matches for \"x\" in buffer: *test-occur*
283 :a 283 :a
284 2:bx 284 2:bx
285------- 285-------
@@ -302,7 +302,7 @@ f
302gx 302gx
303h 303h
304" "\ 304" "\
3053 matches for \"x\" in buffer: *temp*<2> 3053 matches for \"x\" in buffer: *test-occur*
306 :a 306 :a
307 2:bx 307 2:bx
308 :c 308 :c
@@ -321,14 +321,19 @@ Each element has the format:
321 (let ((regexp (nth 0 test)) 321 (let ((regexp (nth 0 test))
322 (nlines (nth 1 test)) 322 (nlines (nth 1 test))
323 (input-buffer-string (nth 2 test)) 323 (input-buffer-string (nth 2 test))
324 (output-buffer-string (nth 3 test))) 324 (output-buffer-string (nth 3 test))
325 (save-window-excursion 325 (temp-buffer (get-buffer-create " *test-occur*")))
326 (with-temp-buffer 326 (unwind-protect
327 (insert input-buffer-string) 327 (save-window-excursion
328 (occur regexp nlines) 328 (with-current-buffer temp-buffer
329 (equal output-buffer-string 329 (erase-buffer)
330 (with-current-buffer "*Occur*" 330 (insert input-buffer-string)
331 (buffer-string))))))) 331 (occur regexp nlines)
332 (equal output-buffer-string
333 (with-current-buffer "*Occur*"
334 (buffer-string)))))
335 (and (buffer-name temp-buffer)
336 (kill-buffer temp-buffer)))))
332 337
333(ert-deftest occur-tests () 338(ert-deftest occur-tests ()
334 "Test the functionality of `occur'. 339 "Test the functionality of `occur'.