aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichal Nazarewicz <[email protected]>2014-06-05 16:42:45 +0200
committerMichal Nazarewicz <[email protected]>2014-06-05 16:42:45 +0200
commit1d7f01eeed9b36fcfbb0d7a5de503a418b43814c (patch)
tree10a6b8bd68022b417d02c50fcbbf0449bcc89890 /test
parent03d7d160c3c7f31f1fee84b1bdcd252a8cec7b99 (diff)
* tests/automated/tildify-tests.el (tildify-test--test): Optimise the
test slightly by reusing the same temporary buffer across multiple test cases.
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog4
-rw-r--r--test/automated/tildify-tests.el10
2 files changed, 9 insertions, 5 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 6248d6cb9a..bb8ed89bed 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,5 +1,9 @@
2014-06-05 Michal Nazarewicz <[email protected]>
+ * automated/tildify-tests.el (tildify-test--test): Optimise the test
+ slightly by reusing the same temporary buffer across multiple test
+ cases.
+
* automated/tildify-tests.el (tildify-test-find-env-end-re-bug)
(tildify-test-find-env-group-index-bug): Update to support new
signature of the `tildify-foreach-region-outside-env' function.
diff --git a/test/automated/tildify-tests.el b/test/automated/tildify-tests.el
index cf18320030..86c83d7ac5 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."
"Test tildify running in MODES.
INPUT is the initial content of the buffer and EXPECTED is expected result
after `tildify-buffer' is run."
- (dolist (mode modes)
- (with-temp-buffer
+ (with-temp-buffer
+ (dolist (mode modes)
+ (erase-buffer)
(funcall mode)
(let ((header (concat "Testing `tildify-buffer' in "
(symbol-name mode) "\n")))
(insert header input)
(tildify-buffer t)
- (should (string-equal (concat header expected) (buffer-string)))))
- (with-temp-buffer
- (funcall mode)
+ (should (string-equal (concat header expected) (buffer-string))))
+ (erase-buffer)
(let ((header (concat "Testing `tildify-region' in "
(symbol-name mode) "\n")))
(insert header input)