diff options
| author | Michal Nazarewicz | 2014-06-05 16:42:45 +0200 |
|---|---|---|
| committer | Michal Nazarewicz | 2014-06-05 16:42:45 +0200 |
| commit | 1d7f01eeed9b36fcfbb0d7a5de503a418b43814c (patch) | |
| tree | 10a6b8bd68022b417d02c50fcbbf0449bcc89890 | |
| parent | 03d7d160c3c7f31f1fee84b1bdcd252a8cec7b99 (diff) | |
| download | emacs-1d7f01eeed9b36fcfbb0d7a5de503a418b43814c.tar.gz emacs-1d7f01eeed9b36fcfbb0d7a5de503a418b43814c.zip | |
* tests/automated/tildify-tests.el (tildify-test--test): Optimise the
test slightly by reusing the same temporary buffer across multiple
test cases.
| -rw-r--r-- | test/ChangeLog | 4 | ||||
| -rw-r--r-- | test/automated/tildify-tests.el | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 6248d6cb9a6..bb8ed89bed0 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2014-06-05 Michal Nazarewicz <mina86@mina86.com> | 1 | 2014-06-05 Michal Nazarewicz <mina86@mina86.com> |
| 2 | 2 | ||
| 3 | * automated/tildify-tests.el (tildify-test--test): Optimise the test | ||
| 4 | slightly by reusing the same temporary buffer across multiple test | ||
| 5 | cases. | ||
| 6 | |||
| 3 | * automated/tildify-tests.el (tildify-test-find-env-end-re-bug) | 7 | * automated/tildify-tests.el (tildify-test-find-env-end-re-bug) |
| 4 | (tildify-test-find-env-group-index-bug): Update to support new | 8 | (tildify-test-find-env-group-index-bug): Update to support new |
| 5 | signature of the `tildify-foreach-region-outside-env' function. | 9 | signature of the `tildify-foreach-region-outside-env' function. |
diff --git a/test/automated/tildify-tests.el b/test/automated/tildify-tests.el index cf18320030d..86c83d7ac5b 100644 --- a/test/automated/tildify-tests.el +++ b/test/automated/tildify-tests.el | |||
| @@ -54,16 +54,16 @@ If IS-XML is non-nil, <pre> tag is not treated specially." | |||
| 54 | "Test tildify running in MODES. | 54 | "Test tildify running in MODES. |
| 55 | INPUT is the initial content of the buffer and EXPECTED is expected result | 55 | INPUT is the initial content of the buffer and EXPECTED is expected result |
| 56 | after `tildify-buffer' is run." | 56 | after `tildify-buffer' is run." |
| 57 | (dolist (mode modes) | 57 | (with-temp-buffer |
| 58 | (with-temp-buffer | 58 | (dolist (mode modes) |
| 59 | (erase-buffer) | ||
| 59 | (funcall mode) | 60 | (funcall mode) |
| 60 | (let ((header (concat "Testing `tildify-buffer' in " | 61 | (let ((header (concat "Testing `tildify-buffer' in " |
| 61 | (symbol-name mode) "\n"))) | 62 | (symbol-name mode) "\n"))) |
| 62 | (insert header input) | 63 | (insert header input) |
| 63 | (tildify-buffer t) | 64 | (tildify-buffer t) |
| 64 | (should (string-equal (concat header expected) (buffer-string))))) | 65 | (should (string-equal (concat header expected) (buffer-string)))) |
| 65 | (with-temp-buffer | 66 | (erase-buffer) |
| 66 | (funcall mode) | ||
| 67 | (let ((header (concat "Testing `tildify-region' in " | 67 | (let ((header (concat "Testing `tildify-region' in " |
| 68 | (symbol-name mode) "\n"))) | 68 | (symbol-name mode) "\n"))) |
| 69 | (insert header input) | 69 | (insert header input) |