diff options
| author | Mattias EngdegÄrd | 2025-03-02 15:20:11 +0100 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2025-03-03 10:49:09 +0100 |
| commit | 932397ce52ec0fa112afcd8d52324b8cdfbb66af (patch) | |
| tree | 3e98c8628d52235a5382abbd3f8fda760c2bcfff /test | |
| parent | 773108fc0456c6c164aa60881929fdd59232c946 (diff) | |
| download | emacs-932397ce52ec0fa112afcd8d52324b8cdfbb66af.tar.gz emacs-932397ce52ec0fa112afcd8d52324b8cdfbb66af.zip | |
Strengthen widget-get/put tests
* test/lisp/wid-edit-tests.el
(widget-test-editable-field-widget-get/put): Test on inherited properties.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/wid-edit-tests.el | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/lisp/wid-edit-tests.el b/test/lisp/wid-edit-tests.el index 1a3a35ff496..cf74a19a0ea 100644 --- a/test/lisp/wid-edit-tests.el +++ b/test/lisp/wid-edit-tests.el | |||
| @@ -33,7 +33,18 @@ | |||
| 33 | (should (eq (widget-put widget :size 1) 1)) | 33 | (should (eq (widget-put widget :size 1) 1)) |
| 34 | (should (equal (widget-put widget :format "foo") "foo")) | 34 | (should (equal (widget-put widget :format "foo") "foo")) |
| 35 | (should (eq (widget-get widget :size) 1)) | 35 | (should (eq (widget-get widget :size) 1)) |
| 36 | (should (equal (widget-get widget :format) "foo"))))) | 36 | (should (equal (widget-get widget :format) "foo")) |
| 37 | |||
| 38 | ;; test get/put for inherited properties | ||
| 39 | (should-not (plist-member (cdr widget) :validate)) | ||
| 40 | (should (eq (widget-get widget :validate) 'widget-field-validate)) | ||
| 41 | (should (eq (widget-put widget :validate 'my-silly-validate) | ||
| 42 | 'my-silly-validate)) | ||
| 43 | (should (plist-member (cdr widget) :validate)) | ||
| 44 | (should (eq (widget-get widget :validate) 'my-silly-validate)) | ||
| 45 | (should (eq (widget-get (get (widget-type widget) 'widget-type) | ||
| 46 | :validate) | ||
| 47 | 'widget-field-validate))))) | ||
| 37 | 48 | ||
| 38 | (ert-deftest widget-at () | 49 | (ert-deftest widget-at () |
| 39 | (with-temp-buffer | 50 | (with-temp-buffer |