diff options
| author | Paul Eggert | 2020-01-07 11:23:11 -0800 |
|---|---|---|
| committer | Paul Eggert | 2020-01-07 11:29:42 -0800 |
| commit | 724af7671590cd91df37f64df6be73f6dca0144d (patch) | |
| tree | 075df63dcdc3653ff710ce49a5f238c165d0f0c1 /test/src | |
| parent | f950b078a6f2fd011312e9471998edf6b5fb957e (diff) | |
| download | emacs-724af7671590cd91df37f64df6be73f6dca0144d.tar.gz emacs-724af7671590cd91df37f64df6be73f6dca0144d.zip | |
Fix sxhash-equal on bytecodes, markers, etc.
Problem reported by Pip Cet (Bug#38912#14).
* doc/lispref/objects.texi (Equality Predicates):
Document better when ‘equal’ looks inside objects.
* doc/lispref/windows.texi (Window Configurations):
Don’t say that ‘equal’ looks inside window configurations.
* etc/NEWS: Mention the change.
* src/fns.c (internal_equal):
Do not look inside window configurations.
(sxhash_obj): Hash markers, byte-code function objects,
char-tables, and font objects consistently with Fequal.
* src/window.c (compare_window_configurations):
Now static. Remove last argument. Caller changed.
* test/lisp/ffap-tests.el (ffap-other-window--bug-25352):
Use compare-window-configurations, not ‘equal’.
* test/src/fns-tests.el (test-sxhash-equal): New test.
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/fns-tests.el | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el index 60be2c6c2d7..c6ceae4a00e 100644 --- a/test/src/fns-tests.el +++ b/test/src/fns-tests.el | |||
| @@ -858,6 +858,22 @@ | |||
| 858 | (puthash k k h))) | 858 | (puthash k k h))) |
| 859 | (should (= 100 (hash-table-count h))))) | 859 | (should (= 100 (hash-table-count h))))) |
| 860 | 860 | ||
| 861 | (ert-deftest test-sxhash-equal () | ||
| 862 | (should (= (sxhash-equal (* most-positive-fixnum most-negative-fixnum)) | ||
| 863 | (sxhash-equal (* most-positive-fixnum most-negative-fixnum)))) | ||
| 864 | (should (= (sxhash-equal (make-string 1000 ?a)) | ||
| 865 | (sxhash-equal (make-string 1000 ?a)))) | ||
| 866 | (should (= (sxhash-equal (point-marker)) | ||
| 867 | (sxhash-equal (point-marker)))) | ||
| 868 | (should (= (sxhash-equal (make-vector 1000 (make-string 10 ?a))) | ||
| 869 | (sxhash-equal (make-vector 1000 (make-string 10 ?a))))) | ||
| 870 | (should (= (sxhash-equal (make-bool-vector 1000 t)) | ||
| 871 | (sxhash-equal (make-bool-vector 1000 t)))) | ||
| 872 | (should (= (sxhash-equal (make-char-table nil (make-string 10 ?a))) | ||
| 873 | (sxhash-equal (make-char-table nil (make-string 10 ?a))))) | ||
| 874 | (should (= (sxhash-equal (record 'a (make-string 10 ?a))) | ||
| 875 | (sxhash-equal (record 'a (make-string 10 ?a)))))) | ||
| 876 | |||
| 861 | (ert-deftest test-secure-hash () | 877 | (ert-deftest test-secure-hash () |
| 862 | (should (equal (secure-hash 'md5 "foobar") | 878 | (should (equal (secure-hash 'md5 "foobar") |
| 863 | "3858f62230ac3c915f300c664312c63f")) | 879 | "3858f62230ac3c915f300c664312c63f")) |