diff options
| author | Stefan Monnier | 2014-12-22 15:13:02 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2014-12-22 15:13:02 -0500 |
| commit | bcebc831bb9c1fd82b4693e6a091a4cf591dc3ec (patch) | |
| tree | 1fe8d3bf282f4cc676396aec6f4b02424a8b01f0 /test | |
| parent | b11d8924b565bd96939537b10a70bb3c26532bed (diff) | |
| download | emacs-bcebc831bb9c1fd82b4693e6a091a4cf591dc3ec.tar.gz emacs-bcebc831bb9c1fd82b4693e6a091a4cf591dc3ec.zip | |
* lisp/emacs-lisp/eieio*.el: Use hashtables rather than obarrays
* lisp/emacs-lisp/eieio-core.el (class): Rename field symbol-obarray to
symbol-hashtable. It contains a hashtable instead of an obarray.
(generic-p): Use symbol property `eieio-method-hashtable' instead of
`eieio-method-obarray'.
(generic-primary-only-p, generic-primary-only-one-p):
Slight optimization.
(eieio-defclass-autoload-map): Use a hashtable instead of an obarray.
(eieio-defclass-autoload, eieio-defclass): Adjust/simplify accordingly.
(eieio-class-un-autoload): Use autoload-do-load.
(eieio-defclass): Use dolist, cl-pushnew, cl-callf.
Use new cl-deftype-satisfies. Adjust to use of hashtables.
Don't hardcode the value of eieio--object-num-slots.
(eieio-defgeneric-form-primary-only-one): Remove `doc-string' arg.
Use a closure rather than a backquoted lambda.
(eieio--defmethod): Adjust call accordingly. Set doc-string via the
function-documentation property.
(eieio-slot-originating-class-p, eieio-slot-name-index)
(eieiomt--optimizing-hashtable, eieiomt-install, eieiomt-add)
(eieio-generic-form): Adjust to use of hashtables.
(eieiomt--sym-optimize): Rename from eieiomt-sym-optimize; take
additional class argument.
(eieio-generic-call-methodname): Remove, unused.
* lisp/emacs-lisp/eieio-custom.el: Use lexical-binding.
(eieio-object-value-to-abstract): Simplify.
* lisp/emacs-lisp/eieio-datadebug.el: Use lexical-binding.
* lisp/emacs-lisp/eieio-opt.el (eieio-build-class-list): Use cl-mapcan.
(eieio-build-class-alist): Use dolist.
(eieio-all-generic-functions): Adjust to use of hashtables.
* lisp/emacs-lisp/eieio.el (child-of-class-p): Fix case where `class' is
`eieio-default-superclass'.
* test/automated/eieio-test-methodinvoke.el (eieio-test-method-store):
Remove use of eieio-generic-call-methodname.
(eieio-test-method-order-list-3, eieio-test-method-order-list-6)
(eieio-test-method-order-list-7, eieio-test-method-order-list-8):
Adjust the expected result accordingly.
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-slot-type-is-class-p):
Prefer \' to $.
Diffstat (limited to 'test')
| -rw-r--r-- | test/ChangeLog | 22 | ||||
| -rw-r--r-- | test/automated/eieio-test-methodinvoke.el | 45 |
2 files changed, 37 insertions, 30 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 7d23b3efe1c..bcc619a7f97 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2014-12-22 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * automated/eieio-test-methodinvoke.el (eieio-test-method-store): | ||
| 4 | Remove use of eieio-generic-call-methodname. | ||
| 5 | (eieio-test-method-order-list-3, eieio-test-method-order-list-6) | ||
| 6 | (eieio-test-method-order-list-7, eieio-test-method-order-list-8): | ||
| 7 | Adjust the expected result accordingly. | ||
| 8 | |||
| 1 | 2014-12-19 Artur Malabarba <bruce.connor.am@gmail.com> | 9 | 2014-12-19 Artur Malabarba <bruce.connor.am@gmail.com> |
| 2 | 10 | ||
| 3 | * automated/let-alist.el: require `cl-lib' | 11 | * automated/let-alist.el: require `cl-lib' |
| @@ -27,8 +35,8 @@ | |||
| 27 | (vc-test--create-repo-function): Rename from | 35 | (vc-test--create-repo-function): Rename from |
| 28 | `vc-test--create-repo-if-not-supported'. Adapt all callees. | 36 | `vc-test--create-repo-if-not-supported'. Adapt all callees. |
| 29 | (vc-test--create-repo): Check also for revision-granularity. | 37 | (vc-test--create-repo): Check also for revision-granularity. |
| 30 | (vc-test--unregister-function): Additional argument FILE. Adapt | 38 | (vc-test--unregister-function): Additional argument FILE. |
| 31 | all callees. | 39 | Adapt all callees. |
| 32 | (vc-test--working-revision): New defun. | 40 | (vc-test--working-revision): New defun. |
| 33 | (vc-test-*-working-revision): New tests. | 41 | (vc-test-*-working-revision): New tests. |
| 34 | 42 | ||
| @@ -65,7 +73,7 @@ | |||
| 65 | 2014-11-21 Ulf Jasper <ulf.jasper@web.de> | 73 | 2014-11-21 Ulf Jasper <ulf.jasper@web.de> |
| 66 | 74 | ||
| 67 | * automated/libxml-tests.el | 75 | * automated/libxml-tests.el |
| 68 | (libxml-tests--data-comments-preserved): Renamed from | 76 | (libxml-tests--data-comments-preserved): Rename from |
| 69 | 'libxml-tests--data'. | 77 | 'libxml-tests--data'. |
| 70 | (libxml-tests--data-comments-discarded): New. | 78 | (libxml-tests--data-comments-discarded): New. |
| 71 | (libxml-tests): Check whether 'libxml-parse-xml-region' is | 79 | (libxml-tests): Check whether 'libxml-parse-xml-region' is |
| @@ -92,8 +100,8 @@ | |||
| 92 | 100 | ||
| 93 | 2014-11-17 Ulf Jasper <ulf.jasper@web.de> | 101 | 2014-11-17 Ulf Jasper <ulf.jasper@web.de> |
| 94 | 102 | ||
| 95 | * automated/icalendar-tests.el (icalendar-tests--test-export): New | 103 | * automated/icalendar-tests.el (icalendar-tests--test-export): |
| 96 | optional parameter `alarms'. | 104 | New optional parameter `alarms'. |
| 97 | (icalendar-export-alarms): New test for exporting icalendar | 105 | (icalendar-export-alarms): New test for exporting icalendar |
| 98 | alarms. | 106 | alarms. |
| 99 | (icalendar-tests--test-cycle): Let `icalendar-export-alarms' be nil. | 107 | (icalendar-tests--test-cycle): Let `icalendar-export-alarms' be nil. |
| @@ -107,8 +115,8 @@ | |||
| 107 | 115 | ||
| 108 | 2014-11-16 Ulf Jasper <ulf.jasper@web.de> | 116 | 2014-11-16 Ulf Jasper <ulf.jasper@web.de> |
| 109 | 117 | ||
| 110 | * automated/icalendar-tests.el (icalendar--parse-vtimezone): Add | 118 | * automated/icalendar-tests.el (icalendar--parse-vtimezone): |
| 111 | testcase where offsets of standard time and daylight saving time | 119 | Add testcase where offsets of standard time and daylight saving time |
| 112 | are equal. | 120 | are equal. |
| 113 | (icalendar-real-world): Fix error in test case. Expected result | 121 | (icalendar-real-world): Fix error in test case. Expected result |
| 114 | was wrong when offsets of standard time and daylight saving time | 122 | was wrong when offsets of standard time and daylight saving time |
diff --git a/test/automated/eieio-test-methodinvoke.el b/test/automated/eieio-test-methodinvoke.el index 0b0dd5d2465..20b47a771d8 100644 --- a/test/automated/eieio-test-methodinvoke.el +++ b/test/automated/eieio-test-methodinvoke.el | |||
| @@ -61,9 +61,8 @@ | |||
| 61 | "Store current invocation class symbol in the invocation order list." | 61 | "Store current invocation class symbol in the invocation order list." |
| 62 | (let* ((keysym (aref [ :STATIC :BEFORE :PRIMARY :AFTER ] | 62 | (let* ((keysym (aref [ :STATIC :BEFORE :PRIMARY :AFTER ] |
| 63 | (or eieio-generic-call-key 0))) | 63 | (or eieio-generic-call-key 0))) |
| 64 | (c (list eieio-generic-call-methodname keysym (eieio--scoped-class)))) | 64 | (c (list keysym (eieio--scoped-class)))) |
| 65 | (setq eieio-test-method-order-list | 65 | (push c eieio-test-method-order-list))) |
| 66 | (cons c eieio-test-method-order-list)))) | ||
| 67 | 66 | ||
| 68 | (defun eieio-test-match (rightanswer) | 67 | (defun eieio-test-match (rightanswer) |
| 69 | "Do a test match." | 68 | "Do a test match." |
| @@ -120,17 +119,17 @@ | |||
| 120 | (ert-deftest eieio-test-method-order-list-3 () | 119 | (ert-deftest eieio-test-method-order-list-3 () |
| 121 | (let ((eieio-test-method-order-list nil) | 120 | (let ((eieio-test-method-order-list nil) |
| 122 | (ans '( | 121 | (ans '( |
| 123 | (eitest-F :BEFORE eitest-B) | 122 | (:BEFORE eitest-B) |
| 124 | (eitest-F :BEFORE eitest-B-base1) | 123 | (:BEFORE eitest-B-base1) |
| 125 | (eitest-F :BEFORE eitest-B-base2) | 124 | (:BEFORE eitest-B-base2) |
| 126 | 125 | ||
| 127 | (eitest-F :PRIMARY eitest-B) | 126 | (:PRIMARY eitest-B) |
| 128 | (eitest-F :PRIMARY eitest-B-base1) | 127 | (:PRIMARY eitest-B-base1) |
| 129 | (eitest-F :PRIMARY eitest-B-base2) | 128 | (:PRIMARY eitest-B-base2) |
| 130 | 129 | ||
| 131 | (eitest-F :AFTER eitest-B-base2) | 130 | (:AFTER eitest-B-base2) |
| 132 | (eitest-F :AFTER eitest-B-base1) | 131 | (:AFTER eitest-B-base1) |
| 133 | (eitest-F :AFTER eitest-B) | 132 | (:AFTER eitest-B) |
| 134 | ))) | 133 | ))) |
| 135 | (eitest-F (eitest-B nil)) | 134 | (eitest-F (eitest-B nil)) |
| 136 | (setq eieio-test-method-order-list (nreverse eieio-test-method-order-list)) | 135 | (setq eieio-test-method-order-list (nreverse eieio-test-method-order-list)) |
| @@ -193,9 +192,9 @@ | |||
| 193 | (ert-deftest eieio-test-method-order-list-6 () | 192 | (ert-deftest eieio-test-method-order-list-6 () |
| 194 | (let ((eieio-test-method-order-list nil) | 193 | (let ((eieio-test-method-order-list nil) |
| 195 | (ans '( | 194 | (ans '( |
| 196 | (constructor :STATIC C) | 195 | (:STATIC C) |
| 197 | (constructor :STATIC C-base1) | 196 | (:STATIC C-base1) |
| 198 | (constructor :STATIC C-base2) | 197 | (:STATIC C-base2) |
| 199 | ))) | 198 | ))) |
| 200 | (C nil) | 199 | (C nil) |
| 201 | (setq eieio-test-method-order-list (nreverse eieio-test-method-order-list)) | 200 | (setq eieio-test-method-order-list (nreverse eieio-test-method-order-list)) |
| @@ -238,10 +237,10 @@ | |||
| 238 | (ert-deftest eieio-test-method-order-list-7 () | 237 | (ert-deftest eieio-test-method-order-list-7 () |
| 239 | (let ((eieio-test-method-order-list nil) | 238 | (let ((eieio-test-method-order-list nil) |
| 240 | (ans '( | 239 | (ans '( |
| 241 | (eitest-F :PRIMARY D) | 240 | (:PRIMARY D) |
| 242 | (eitest-F :PRIMARY D-base1) | 241 | (:PRIMARY D-base1) |
| 243 | ;; (eitest-F :PRIMARY D-base2) | 242 | ;; (:PRIMARY D-base2) |
| 244 | (eitest-F :PRIMARY D-base0) | 243 | (:PRIMARY D-base0) |
| 245 | ))) | 244 | ))) |
| 246 | (eitest-F (D nil)) | 245 | (eitest-F (D nil)) |
| 247 | (setq eieio-test-method-order-list (nreverse eieio-test-method-order-list)) | 246 | (setq eieio-test-method-order-list (nreverse eieio-test-method-order-list)) |
| @@ -277,10 +276,10 @@ | |||
| 277 | (ert-deftest eieio-test-method-order-list-8 () | 276 | (ert-deftest eieio-test-method-order-list-8 () |
| 278 | (let ((eieio-test-method-order-list nil) | 277 | (let ((eieio-test-method-order-list nil) |
| 279 | (ans '( | 278 | (ans '( |
| 280 | (eitest-F :PRIMARY E) | 279 | (:PRIMARY E) |
| 281 | (eitest-F :PRIMARY E-base1) | 280 | (:PRIMARY E-base1) |
| 282 | (eitest-F :PRIMARY E-base2) | 281 | (:PRIMARY E-base2) |
| 283 | (eitest-F :PRIMARY E-base0) | 282 | (:PRIMARY E-base0) |
| 284 | ))) | 283 | ))) |
| 285 | (eitest-F (E nil)) | 284 | (eitest-F (E nil)) |
| 286 | (setq eieio-test-method-order-list (nreverse eieio-test-method-order-list)) | 285 | (setq eieio-test-method-order-list (nreverse eieio-test-method-order-list)) |