diff options
| author | Michael R. Mauger | 2017-07-03 15:32:41 -0400 |
|---|---|---|
| committer | Michael R. Mauger | 2017-07-03 15:32:41 -0400 |
| commit | 776635c01abd4aa759e7aa9584b513146978568c (patch) | |
| tree | 554f444bc96cb6b05435e8bf195de4df1b00df8f /test/src/alloc-tests.el | |
| parent | 77083e2d34ba5559ae2899d3b03cf08c2e6c5ad4 (diff) | |
| parent | 4cd0db3d6e6e4d5bd49283483bdafbbfc0f583f1 (diff) | |
| download | emacs-776635c01abd4aa759e7aa9584b513146978568c.tar.gz emacs-776635c01abd4aa759e7aa9584b513146978568c.zip | |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'test/src/alloc-tests.el')
| -rw-r--r-- | test/src/alloc-tests.el | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/src/alloc-tests.el b/test/src/alloc-tests.el index af4ad6c6355..1cf1fc3be5c 100644 --- a/test/src/alloc-tests.el +++ b/test/src/alloc-tests.el | |||
| @@ -31,3 +31,23 @@ | |||
| 31 | 31 | ||
| 32 | (ert-deftest finalizer-object-type () | 32 | (ert-deftest finalizer-object-type () |
| 33 | (should (equal (type-of (make-finalizer nil)) 'finalizer))) | 33 | (should (equal (type-of (make-finalizer nil)) 'finalizer))) |
| 34 | |||
| 35 | (ert-deftest record-1 () | ||
| 36 | (let ((x (record 'foo 1 2 3))) | ||
| 37 | (should (recordp x)) | ||
| 38 | (should (eq (type-of x) 'foo)) | ||
| 39 | (should (eq (aref x 0) 'foo)) | ||
| 40 | (should (eql (aref x 3) 3)) | ||
| 41 | (should (eql (length x) 4)))) | ||
| 42 | |||
| 43 | (ert-deftest record-2 () | ||
| 44 | (let ((x (make-record 'bar 1 0))) | ||
| 45 | (should (eql (length x) 2)) | ||
| 46 | (should (eql (aref x 1) 0)))) | ||
| 47 | |||
| 48 | (ert-deftest record-3 () | ||
| 49 | (let* ((x (record 'foo 1 2 3)) | ||
| 50 | (y (copy-sequence x))) | ||
| 51 | (should-not (eq x y)) | ||
| 52 | (dotimes (i 4) | ||
| 53 | (should (eql (aref x i) (aref y i)))))) | ||