diff options
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/emacs-module-tests.el | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el index 6f14d4f7fa3..de707a4243a 100644 --- a/test/src/emacs-module-tests.el +++ b/test/src/emacs-module-tests.el | |||
| @@ -270,6 +270,24 @@ must evaluate to a regular expression string." | |||
| 270 | (mod-test-invalid-store) | 270 | (mod-test-invalid-store) |
| 271 | (mod-test-invalid-load))) | 271 | (mod-test-invalid-load))) |
| 272 | 272 | ||
| 273 | (ert-deftest module--test-assertions--load-non-live-object-with-global-copy () | ||
| 274 | "Check that -module-assertions verify that non-live objects aren't accessed. | ||
| 275 | This differs from `module--test-assertions-load-non-live-object' | ||
| 276 | in that it stows away a global reference. The module assertions | ||
| 277 | should nevertheless detect the invalid load." | ||
| 278 | (skip-unless (or (file-executable-p mod-test-emacs) | ||
| 279 | (and (eq system-type 'windows-nt) | ||
| 280 | (file-executable-p (concat mod-test-emacs ".exe"))))) | ||
| 281 | ;; This doesn't yet cause undefined behavior. | ||
| 282 | (should (eq (mod-test-invalid-store-copy) 123)) | ||
| 283 | (module--test-assertion (rx "Emacs value not found in " | ||
| 284 | (+ digit) " values of " | ||
| 285 | (+ digit) " environments\n") | ||
| 286 | ;; Storing and reloading a local value causes undefined behavior, | ||
| 287 | ;; which should be detected by the module assertions. | ||
| 288 | (mod-test-invalid-store-copy) | ||
| 289 | (mod-test-invalid-load))) | ||
| 290 | |||
| 273 | (ert-deftest module--test-assertions--call-emacs-from-gc () | 291 | (ert-deftest module--test-assertions--call-emacs-from-gc () |
| 274 | "Check that -module-assertions prevents calling Emacs functions | 292 | "Check that -module-assertions prevents calling Emacs functions |
| 275 | during garbage collection." | 293 | during garbage collection." |