if (EQ (tail, li.tortoise))
circular_list (plist);
}
- CHECK_LIST_END (tail, plist);
+ CHECK_TYPE (NILP (tail), Qplistp, plist);
Lisp_Object newcell
= Fcons (prop, Fcons (val, NILP (prev) ? plist : XCDR (XCDR (prev))));
if (NILP (prev))
circular_list (plist);
}
- CHECK_LIST_END (tail, plist);
+ CHECK_TYPE (NILP (tail), Qplistp, plist);
return Qnil;
}
if (EQ (tail, li.tortoise))
circular_list (plist);
}
- CHECK_LIST_END (tail, plist);
+ CHECK_TYPE (NILP (tail), Qplistp, plist);
Lisp_Object newcell = list2 (prop, val);
if (NILP (prev))
return newcell;
if (EQ (tail, li.tortoise))
circular_list (tail);
}
- CHECK_LIST_END (tail, plist);
+ CHECK_TYPE (NILP (tail), Qplistp, plist);
return Qnil;
}
Fmake_var_non_special (Qfeatures);
DEFSYM (Qsubfeatures, "subfeatures");
DEFSYM (Qfuncall, "funcall");
+ DEFSYM (Qplistp, "plistp");
#ifdef HAVE_LANGINFO_CODESET
DEFSYM (Qcodeset, "codeset");
(should-error (nconc (cyc1 1) 'tail) :type 'circular-list)
(should-error (nconc (cyc2 1 2) 'tail) :type 'circular-list))
+(ert-deftest plist-get/odd-number-of-elements ()
+ "Test that ‘plist-get’ doesn’t signal an error on degenerate plists."
+ (should-not (plist-get '(:foo 1 :bar) :bar)))
+
+(ert-deftest lax-plist-get/odd-number-of-elements ()
+ "Check for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27726."
+ (should (equal (should-error (lax-plist-get '(:foo 1 :bar) :bar)
+ :type 'wrong-type-argument)
+ '(wrong-type-argument plistp (:foo 1 :bar)))))
+
+(ert-deftest plist-put/odd-number-of-elements ()
+ "Check for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27726."
+ (should (equal (should-error (plist-put '(:foo 1 :bar) :zot 2)
+ :type 'wrong-type-argument)
+ '(wrong-type-argument plistp (:foo 1 :bar)))))
+
+(ert-deftest lax-plist-put/odd-number-of-elements ()
+ "Check for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27726."
+ (should (equal (should-error (lax-plist-put '(:foo 1 :bar) :zot 2)
+ :type 'wrong-type-argument)
+ '(wrong-type-argument plistp (:foo 1 :bar)))))
+
+(ert-deftest plist-member/improper-list ()
+ "Check for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27726."
+ (should (equal (should-error (plist-member '(:foo 1 . :bar) :qux)
+ :type 'wrong-type-argument)
+ '(wrong-type-argument plistp (:foo 1 . :bar)))))
+
(provide 'fns-tests)