diff options
author | Philipp Stephani <phst@google.com> | 2016-09-24 18:07:16 +0200 |
---|---|---|
committer | Philipp Stephani <phst@google.com> | 2016-09-28 11:31:12 +0200 |
commit | e9b0db72c8bbe9a1af60f59826eafeadc9210b25 (patch) | |
tree | f0b1dd4b3fb5769afe3fb764ee0dccaf59827600 /dev | |
parent | cd6ee67a6651b5e097dbfb35ba801215711741df (diff) |
Use save-match-data consistently
Some functions already use save-match-data, but not all. Use
save-match-data around every function that modifies the match data, and
verify in the unit tests that the match data is indeed saved.
Diffstat (limited to 'dev')
-rw-r--r-- | dev/examples-to-tests.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/dev/examples-to-tests.el b/dev/examples-to-tests.el index 57db6cc..3c538f0 100644 --- a/dev/examples-to-tests.el +++ b/dev/examples-to-tests.el @@ -3,7 +3,9 @@ (defun examples-to-should-1 (examples) (let ((actual (car examples)) (expected (cadr (cdr examples)))) - `(should (equal-including-properties ,actual ,expected)))) + `(let ((previous-match-data (match-data))) + (should (equal-including-properties ,actual ,expected)) + (should (equal (match-data) previous-match-data))))) (defun examples-to-should (examples) (let (result) |