Commit d8efda90 authored by Juri Linkov's avatar Juri Linkov
Browse files

* test/automated/occur-tests.el (occur-test-case): Use predefined

buffer name " *test-occur*" instead of a random buffer name.
parent 17711ed9
2012-07-29 Juri Linkov <juri@jurta.org>
* automated/occur-tests.el (occur-test-case): Use predefined
buffer name " *test-occur*" instead of a random buffer name.
2012-07-20 Dmitry Gutov <dgutov@yandex.ru> 2012-07-20 Dmitry Gutov <dgutov@yandex.ru>
* automated/ruby-mode-tests.el: New file with one test. * automated/ruby-mode-tests.el: New file with one test.
......
...@@ -35,7 +35,7 @@ xd ...@@ -35,7 +35,7 @@ xd
xex xex
fx fx
" "\ " "\
5 matches for \"x\" in buffer: *temp*<2> 5 matches for \"x\" in buffer: *test-occur*
1:xa 1:xa
3:cx 3:cx
4:xd 4:xd
...@@ -52,7 +52,7 @@ a ...@@ -52,7 +52,7 @@ a
a a
a a
" "\ " "\
2 matches for \"a^Ja\" in buffer: *temp*<2> 2 matches for \"a^Ja\" in buffer: *test-occur*
1:a 1:a
:a :a
3:a 3:a
...@@ -68,7 +68,7 @@ c ...@@ -68,7 +68,7 @@ c
a a
b b
" "\ " "\
2 matches for \"a^Jb\" in buffer: *temp*<2> 2 matches for \"a^Jb\" in buffer: *test-occur*
1:a 1:a
:b :b
4:a 4:a
...@@ -82,7 +82,7 @@ c ...@@ -82,7 +82,7 @@ c
a a
" "\ " "\
2 matches for \"a^J\" in buffer: *temp*<2> 2 matches for \"a^J\" in buffer: *test-occur*
1:a 1:a
: :
4:a 4:a
...@@ -97,7 +97,7 @@ d ...@@ -97,7 +97,7 @@ d
ex ex
fx fx
" "\ " "\
2 matches for \"x^J.x^J\" in buffer: *temp*<2> 2 matches for \"x^J.x^J\" in buffer: *test-occur*
1:ax 1:ax
:bx :bx
:c :c
...@@ -116,7 +116,7 @@ f ...@@ -116,7 +116,7 @@ f
g g
hx hx
" "\ " "\
3 matches for \"x\" in buffer: *temp*<2> 3 matches for \"x\" in buffer: *test-occur*
1:ax 1:ax
:b :b
------- -------
...@@ -136,7 +136,7 @@ d ...@@ -136,7 +136,7 @@ d
ex ex
f f
" "\ " "\
2 matches for \"x\" in buffer: *temp*<2> 2 matches for \"x\" in buffer: *test-occur*
:a :a
2:bx 2:bx
:c :c
...@@ -159,7 +159,7 @@ i ...@@ -159,7 +159,7 @@ i
j j
kx kx
" "\ " "\
5 matches for \"x\" in buffer: *temp*<2> 5 matches for \"x\" in buffer: *test-occur*
1:ax 1:ax
2:bx 2:bx
:c :c
...@@ -184,7 +184,7 @@ gx ...@@ -184,7 +184,7 @@ gx
h h
i i
" "\ " "\
2 matches for \"x\" in buffer: *temp*<2> 2 matches for \"x\" in buffer: *test-occur*
:a :a
:b :b
3:cx 3:cx
...@@ -207,7 +207,7 @@ gx ...@@ -207,7 +207,7 @@ gx
h h
" "\ " "\
2 matches for \"x\" in buffer: *temp*<2> 2 matches for \"x\" in buffer: *test-occur*
: :
:b :b
3:cx 3:cx
...@@ -232,7 +232,7 @@ i ...@@ -232,7 +232,7 @@ i
jx jx
kx kx
" "\ " "\
3 matches for \"x^J.x\" in buffer: *temp*<2> 3 matches for \"x^J.x\" in buffer: *test-occur*
1:ax 1:ax
:bx :bx
:c :c
...@@ -256,7 +256,7 @@ f ...@@ -256,7 +256,7 @@ f
gx gx
hx hx
" "\ " "\
2 matches for \"x^J.x\" in buffer: *temp*<2> 2 matches for \"x^J.x\" in buffer: *test-occur*
1:ax 1:ax
:bx :bx
:c :c
...@@ -279,7 +279,7 @@ g ...@@ -279,7 +279,7 @@ g
h h
ix ix
" "\ " "\
3 matches for \"x\" in buffer: *temp*<2> 3 matches for \"x\" in buffer: *test-occur*
:a :a
2:bx 2:bx
------- -------
...@@ -302,7 +302,7 @@ f ...@@ -302,7 +302,7 @@ f
gx gx
h h
" "\ " "\
3 matches for \"x\" in buffer: *temp*<2> 3 matches for \"x\" in buffer: *test-occur*
:a :a
2:bx 2:bx
:c :c
...@@ -321,14 +321,19 @@ Each element has the format: ...@@ -321,14 +321,19 @@ Each element has the format:
(let ((regexp (nth 0 test)) (let ((regexp (nth 0 test))
(nlines (nth 1 test)) (nlines (nth 1 test))
(input-buffer-string (nth 2 test)) (input-buffer-string (nth 2 test))
(output-buffer-string (nth 3 test))) (output-buffer-string (nth 3 test))
(save-window-excursion (temp-buffer (get-buffer-create " *test-occur*")))
(with-temp-buffer (unwind-protect
(insert input-buffer-string) (save-window-excursion
(occur regexp nlines) (with-current-buffer temp-buffer
(equal output-buffer-string (erase-buffer)
(with-current-buffer "*Occur*" (insert input-buffer-string)
(buffer-string))))))) (occur regexp nlines)
(equal output-buffer-string
(with-current-buffer "*Occur*"
(buffer-string)))))
(and (buffer-name temp-buffer)
(kill-buffer temp-buffer)))))
(ert-deftest occur-tests () (ert-deftest occur-tests ()
"Test the functionality of `occur'. "Test the functionality of `occur'.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment