bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#28489: Acknowledgement (27.0.50; eieio-persistent slot type validati


From: Noam Postavsky
Subject: bug#28489: Acknowledgement (27.0.50; eieio-persistent slot type validation should be a bit smarter)
Date: Sat, 30 Sep 2017 17:58:54 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux)

Eric Abrahamsen <address@hidden> writes:

> Here's the commit as it stands, seems to work fine. I'll let it mellow
> for a while, and then commit to... emacs-26? Since it's technically a
> bug fix?

Yes.  You are missing a (require 'seq) in eieo-base.el though (without
that, I get an error when running 'make -C test eieio-test-persist').

> * lisp/emacs-lisp/eieio-base.el (eieio-persistent-slot-type-is-class-p):
>   An `or' form can specify multiple potential classes (or null) as
>   valid types for a slot, but previously only the final element of the
>   `or' was actually checked. Now returns all valid classes in the `or'
>   form.
> * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value):
>   Check if proposed value matches any of the valid classes.

These 2 entries should be combined like:

* lisp/emacs-lisp/eieio-base.el (eieio-persistent-slot-type-is-class-p):
An `or' form can specify multiple potential classes (or null) as [...]
(eieio-persistent-validate/fix-slot-value): Check if proposed value
matches any of the valid classes.

> +(ert-deftest eieio-test-multiple-class-slot ()
> +  (let ((persist
> +         (persistent-multiclass-slot "random string"
> +          :slot1 (persistent-random-class)
> +          :slot2 (persist-not-persistent)
> +          :file (concat default-directory "test-ps5.pt"))))
> +    (persist-test-save-and-compare persist)
> +    (delete-file (oref persist file))))

I think this test should a bit more thorough about deleting the file,
even if the test fails for some reason:

(unwind-protect
    (persist-test-save-and-compare persist)
  (ignore-errors (delete-file (oref persist file))))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]