diff options
| author | Juri Linkov | 2012-07-29 03:12:13 +0300 |
|---|---|---|
| committer | Juri Linkov | 2012-07-29 03:12:13 +0300 |
| commit | d8efda90aa36b6bea5cca9bd6765cbb76571d933 (patch) | |
| tree | 2d84debb2dc347873cdd36c6d6eec349f78fe4fc | |
| parent | 17711ed9be4253d8e1371f6e771505578725c711 (diff) | |
| download | emacs-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/ChangeLog | 5 | ||||
| -rw-r--r-- | test/automated/occur-tests.el | 49 |
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 @@ | |||
| 1 | 2012-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 | |||
| 1 | 2012-07-20 Dmitry Gutov <dgutov@yandex.ru> | 6 | 2012-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 | |||
| 35 | xex | 35 | xex |
| 36 | fx | 36 | fx |
| 37 | " "\ | 37 | " "\ |
| 38 | 5 matches for \"x\" in buffer: *temp*<2> | 38 | 5 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 | |||
| 52 | a | 52 | a |
| 53 | a | 53 | a |
| 54 | " "\ | 54 | " "\ |
| 55 | 2 matches for \"a^Ja\" in buffer: *temp*<2> | 55 | 2 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 | |||
| 68 | a | 68 | a |
| 69 | b | 69 | b |
| 70 | " "\ | 70 | " "\ |
| 71 | 2 matches for \"a^Jb\" in buffer: *temp*<2> | 71 | 2 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 | |||
| 82 | a | 82 | a |
| 83 | 83 | ||
| 84 | " "\ | 84 | " "\ |
| 85 | 2 matches for \"a^J\" in buffer: *temp*<2> | 85 | 2 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 | |||
| 97 | ex | 97 | ex |
| 98 | fx | 98 | fx |
| 99 | " "\ | 99 | " "\ |
| 100 | 2 matches for \"x^J.x^J\" in buffer: *temp*<2> | 100 | 2 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 | |||
| 116 | g | 116 | g |
| 117 | hx | 117 | hx |
| 118 | " "\ | 118 | " "\ |
| 119 | 3 matches for \"x\" in buffer: *temp*<2> | 119 | 3 matches for \"x\" in buffer: *test-occur* |
| 120 | 1:ax | 120 | 1:ax |
| 121 | :b | 121 | :b |
| 122 | ------- | 122 | ------- |
| @@ -136,7 +136,7 @@ d | |||
| 136 | ex | 136 | ex |
| 137 | f | 137 | f |
| 138 | " "\ | 138 | " "\ |
| 139 | 2 matches for \"x\" in buffer: *temp*<2> | 139 | 2 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 | |||
| 159 | j | 159 | j |
| 160 | kx | 160 | kx |
| 161 | " "\ | 161 | " "\ |
| 162 | 5 matches for \"x\" in buffer: *temp*<2> | 162 | 5 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 | |||
| 184 | h | 184 | h |
| 185 | i | 185 | i |
| 186 | " "\ | 186 | " "\ |
| 187 | 2 matches for \"x\" in buffer: *temp*<2> | 187 | 2 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 | |||
| 207 | h | 207 | h |
| 208 | 208 | ||
| 209 | " "\ | 209 | " "\ |
| 210 | 2 matches for \"x\" in buffer: *temp*<2> | 210 | 2 matches for \"x\" in buffer: *test-occur* |
| 211 | : | 211 | : |
| 212 | :b | 212 | :b |
| 213 | 3:cx | 213 | 3:cx |
| @@ -232,7 +232,7 @@ i | |||
| 232 | jx | 232 | jx |
| 233 | kx | 233 | kx |
| 234 | " "\ | 234 | " "\ |
| 235 | 3 matches for \"x^J.x\" in buffer: *temp*<2> | 235 | 3 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 | |||
| 256 | gx | 256 | gx |
| 257 | hx | 257 | hx |
| 258 | " "\ | 258 | " "\ |
| 259 | 2 matches for \"x^J.x\" in buffer: *temp*<2> | 259 | 2 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 | |||
| 279 | h | 279 | h |
| 280 | ix | 280 | ix |
| 281 | " "\ | 281 | " "\ |
| 282 | 3 matches for \"x\" in buffer: *temp*<2> | 282 | 3 matches for \"x\" in buffer: *test-occur* |
| 283 | :a | 283 | :a |
| 284 | 2:bx | 284 | 2:bx |
| 285 | ------- | 285 | ------- |
| @@ -302,7 +302,7 @@ f | |||
| 302 | gx | 302 | gx |
| 303 | h | 303 | h |
| 304 | " "\ | 304 | " "\ |
| 305 | 3 matches for \"x\" in buffer: *temp*<2> | 305 | 3 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'. |