|
17 | 17 | (should-error (call-interactively (key-binding "w"))))) |
18 | 18 |
|
19 | 19 | (ert-deftest elixir-quoted-minor-mode/multiple-invocation () |
20 | | - (elixir-test-with-temp-buffer |
21 | | - "sum(1,2)" |
22 | | - (elixir-mode-string-to-quoted-on-current-line) |
23 | | - (should (search-forward "{:sum, [line: 1], [1, 2]}" nil t)) |
24 | | - (quit-window) |
25 | | - (erase-buffer) |
26 | | - (insert "sum(3, 2)") |
27 | | - (elixir-mode-string-to-quoted-on-current-line) |
28 | | - (should-not (search-forward "{:sum, [line: 1], [1, 2]}" nil t)) |
29 | | - (should (search-forward "{:sum, [line: 1], [3, 2]}" nil t)))) |
| 20 | + (let ((test-buffer (current-buffer))) |
| 21 | + (elixir-test-with-temp-buffer |
| 22 | + "sum(1,2)" |
| 23 | + (elixir-mode-string-to-quoted-on-current-line) |
| 24 | + (should (search-forward "{:sum, [line: 1], [1, 2]}" nil t)) |
| 25 | + (pop-to-buffer test-buffer) |
| 26 | + (erase-buffer) |
| 27 | + (insert "sum(3, 2)") |
| 28 | + (elixir-mode-string-to-quoted-on-current-line) |
| 29 | + (should-not (search-forward "{:sum, [line: 1], [1, 2]}" nil t)) |
| 30 | + (should (search-forward "{:sum, [line: 1], [3, 2]}" nil t))))) |
30 | 31 |
|
31 | 32 | (ert-deftest elixir-quoted-minor-mode/indentation () |
32 | 33 | (elixir-test-with-temp-buffer |
|
41 | 42 | (should (search-forward " [{:a, [line: 1], nil}" nil t)))) |
42 | 43 |
|
43 | 44 | (ert-deftest elixir-quoted-minor-mode/undo () |
44 | | - (elixir-test-with-temp-buffer |
45 | | - "sum(1, 2)" |
46 | | - (elixir-mode-string-to-quoted-on-current-line) |
47 | | - (should-error (undo)) |
48 | | - (quit-window) |
49 | | - (erase-buffer) |
50 | | - (insert "sum(3, 2)") |
51 | | - (elixir-mode-string-to-quoted-on-current-line) |
52 | | - (should-error (undo)))) |
| 45 | + (let ((test-buffer (current-buffer))) |
| 46 | + (elixir-test-with-temp-buffer |
| 47 | + "sum(1, 2)" |
| 48 | + (elixir-mode-string-to-quoted-on-current-line) |
| 49 | + (should-error (undo)) |
| 50 | + (pop-to-buffer test-buffer) |
| 51 | + (erase-buffer) |
| 52 | + (insert "sum(3, 2)") |
| 53 | + (elixir-mode-string-to-quoted-on-current-line) |
| 54 | + (should-error (undo))))) |
0 commit comments