summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2014-12-22 15:13:02 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2014-12-22 15:13:02 -0500
commitbcebc831bb9c1fd82b4693e6a091a4cf591dc3ec (patch)
tree1fe8d3bf282f4cc676396aec6f4b02424a8b01f0 /test
parentb11d8924b565bd96939537b10a70bb3c26532bed (diff)
downloademacs-bcebc831bb9c1fd82b4693e6a091a4cf591dc3ec.tar.gz
* 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/ChangeLog22
-rw-r--r--test/automated/eieio-test-methodinvoke.el45
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 @@
+2014-12-22 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * 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.
+
2014-12-19 Artur Malabarba <bruce.connor.am@gmail.com>
* automated/let-alist.el: require `cl-lib'
@@ -27,8 +35,8 @@
(vc-test--create-repo-function): Rename from
`vc-test--create-repo-if-not-supported'. Adapt all callees.
(vc-test--create-repo): Check also for revision-granularity.
- (vc-test--unregister-function): Additional argument FILE. Adapt
- all callees.
+ (vc-test--unregister-function): Additional argument FILE.
+ Adapt all callees.
(vc-test--working-revision): New defun.
(vc-test-*-working-revision): New tests.
@@ -65,7 +73,7 @@
2014-11-21 Ulf Jasper <ulf.jasper@web.de>
* automated/libxml-tests.el
- (libxml-tests--data-comments-preserved): Renamed from
+ (libxml-tests--data-comments-preserved): Rename from
'libxml-tests--data'.
(libxml-tests--data-comments-discarded): New.
(libxml-tests): Check whether 'libxml-parse-xml-region' is
@@ -92,8 +100,8 @@
2014-11-17 Ulf Jasper <ulf.jasper@web.de>
- * automated/icalendar-tests.el (icalendar-tests--test-export): New
- optional parameter `alarms'.
+ * automated/icalendar-tests.el (icalendar-tests--test-export):
+ New optional parameter `alarms'.
(icalendar-export-alarms): New test for exporting icalendar
alarms.
(icalendar-tests--test-cycle): Let `icalendar-export-alarms' be nil.
@@ -107,8 +115,8 @@
2014-11-16 Ulf Jasper <ulf.jasper@web.de>
- * automated/icalendar-tests.el (icalendar--parse-vtimezone): Add
- testcase where offsets of standard time and daylight saving time
+ * automated/icalendar-tests.el (icalendar--parse-vtimezone):
+ Add testcase where offsets of standard time and daylight saving time
are equal.
(icalendar-real-world): Fix error in test case. Expected result
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 @@
"Store current invocation class symbol in the invocation order list."
(let* ((keysym (aref [ :STATIC :BEFORE :PRIMARY :AFTER ]
(or eieio-generic-call-key 0)))
- (c (list eieio-generic-call-methodname keysym (eieio--scoped-class))))
- (setq eieio-test-method-order-list
- (cons c eieio-test-method-order-list))))
+ (c (list keysym (eieio--scoped-class))))
+ (push c eieio-test-method-order-list)))
(defun eieio-test-match (rightanswer)
"Do a test match."
@@ -120,17 +119,17 @@
(ert-deftest eieio-test-method-order-list-3 ()
(let ((eieio-test-method-order-list nil)
(ans '(
- (eitest-F :BEFORE eitest-B)
- (eitest-F :BEFORE eitest-B-base1)
- (eitest-F :BEFORE eitest-B-base2)
+ (:BEFORE eitest-B)
+ (:BEFORE eitest-B-base1)
+ (:BEFORE eitest-B-base2)
- (eitest-F :PRIMARY eitest-B)
- (eitest-F :PRIMARY eitest-B-base1)
- (eitest-F :PRIMARY eitest-B-base2)
+ (:PRIMARY eitest-B)
+ (:PRIMARY eitest-B-base1)
+ (:PRIMARY eitest-B-base2)
- (eitest-F :AFTER eitest-B-base2)
- (eitest-F :AFTER eitest-B-base1)
- (eitest-F :AFTER eitest-B)
+ (:AFTER eitest-B-base2)
+ (:AFTER eitest-B-base1)
+ (:AFTER eitest-B)
)))
(eitest-F (eitest-B nil))
(setq eieio-test-method-order-list (nreverse eieio-test-method-order-list))
@@ -193,9 +192,9 @@
(ert-deftest eieio-test-method-order-list-6 ()
(let ((eieio-test-method-order-list nil)
(ans '(
- (constructor :STATIC C)
- (constructor :STATIC C-base1)
- (constructor :STATIC C-base2)
+ (:STATIC C)
+ (:STATIC C-base1)
+ (:STATIC C-base2)
)))
(C nil)
(setq eieio-test-method-order-list (nreverse eieio-test-method-order-list))
@@ -238,10 +237,10 @@
(ert-deftest eieio-test-method-order-list-7 ()
(let ((eieio-test-method-order-list nil)
(ans '(
- (eitest-F :PRIMARY D)
- (eitest-F :PRIMARY D-base1)
- ;; (eitest-F :PRIMARY D-base2)
- (eitest-F :PRIMARY D-base0)
+ (:PRIMARY D)
+ (:PRIMARY D-base1)
+ ;; (:PRIMARY D-base2)
+ (:PRIMARY D-base0)
)))
(eitest-F (D nil))
(setq eieio-test-method-order-list (nreverse eieio-test-method-order-list))
@@ -277,10 +276,10 @@
(ert-deftest eieio-test-method-order-list-8 ()
(let ((eieio-test-method-order-list nil)
(ans '(
- (eitest-F :PRIMARY E)
- (eitest-F :PRIMARY E-base1)
- (eitest-F :PRIMARY E-base2)
- (eitest-F :PRIMARY E-base0)
+ (:PRIMARY E)
+ (:PRIMARY E-base1)
+ (:PRIMARY E-base2)
+ (:PRIMARY E-base0)
)))
(eitest-F (E nil))
(setq eieio-test-method-order-list (nreverse eieio-test-method-order-list))