diff options
| author | Stefan Kangas | 2021-10-21 19:53:00 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2021-10-31 03:02:32 +0100 |
| commit | 54b8ec4e6fb1eeac049e7bd68372e78c180fe8e4 (patch) | |
| tree | ebcb91138aae1c7f7234f0540b9f275c22f19655 /test/src | |
| parent | 8227d1273e2b82dbed14c0cba06959083d377745 (diff) | |
| download | emacs-54b8ec4e6fb1eeac049e7bd68372e78c180fe8e4.tar.gz emacs-54b8ec4e6fb1eeac049e7bd68372e78c180fe8e4.zip | |
Remove workaround for fixed Bug#6581 from ert
* lisp/emacs-lisp/ert.el (ert-equal-including-properties): Make
into obsolete function alias for 'equal-including-properties'.
* test/src/editfns-tests.el (format-properties):
* test/lisp/emacs-lisp/ert-x-tests.el (ert-propertized-string)
(ert-test-run-tests-interactively-2): Don't use above obsolete
name.
(ert--explain-equal-including-properties-rec): New function.
(ert--explain-equal-including-properties): Use as an explainer for
'equal-including-properties' now that Bug#6581 is fixed.
* test/lisp/emacs-lisp/ert-tests.el
(ert-test-explain-equal-string-properties): Expand test.
(ert-test-equal-including-properties): Merge test into above
expanded test.
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/editfns-tests.el | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/test/src/editfns-tests.el b/test/src/editfns-tests.el index a731a95ccf0..e83dd7c857b 100644 --- a/test/src/editfns-tests.el +++ b/test/src/editfns-tests.el | |||
| @@ -23,16 +23,16 @@ | |||
| 23 | 23 | ||
| 24 | (ert-deftest format-properties () | 24 | (ert-deftest format-properties () |
| 25 | ;; Bug #23730 | 25 | ;; Bug #23730 |
| 26 | (should (ert-equal-including-properties | 26 | (should (equal-including-properties |
| 27 | (format (propertize "%d" 'face '(:background "red")) 1) | 27 | (format (propertize "%d" 'face '(:background "red")) 1) |
| 28 | #("1" 0 1 (face (:background "red"))))) | 28 | #("1" 0 1 (face (:background "red"))))) |
| 29 | (should (ert-equal-including-properties | 29 | (should (equal-including-properties |
| 30 | (format (propertize "%2d" 'face '(:background "red")) 1) | 30 | (format (propertize "%2d" 'face '(:background "red")) 1) |
| 31 | #(" 1" 0 2 (face (:background "red"))))) | 31 | #(" 1" 0 2 (face (:background "red"))))) |
| 32 | (should (ert-equal-including-properties | 32 | (should (equal-including-properties |
| 33 | (format (propertize "%02d" 'face '(:background "red")) 1) | 33 | (format (propertize "%02d" 'face '(:background "red")) 1) |
| 34 | #("01" 0 2 (face (:background "red"))))) | 34 | #("01" 0 2 (face (:background "red"))))) |
| 35 | (should (ert-equal-including-properties | 35 | (should (equal-including-properties |
| 36 | (format (concat (propertize "%2d" 'x 'X) | 36 | (format (concat (propertize "%2d" 'x 'X) |
| 37 | (propertize "a" 'a 'A) | 37 | (propertize "a" 'a 'A) |
| 38 | (propertize "b" 'b 'B)) | 38 | (propertize "b" 'b 'B)) |
| @@ -40,27 +40,27 @@ | |||
| 40 | #(" 1ab" 0 2 (x X) 2 3 (a A) 3 4 (b B)))) | 40 | #(" 1ab" 0 2 (x X) 2 3 (a A) 3 4 (b B)))) |
| 41 | 41 | ||
| 42 | ;; Bug #5306 | 42 | ;; Bug #5306 |
| 43 | (should (ert-equal-including-properties | 43 | (should (equal-including-properties |
| 44 | (format "%.10s" | 44 | (format "%.10s" |
| 45 | (concat "1234567890aaaa" | 45 | (concat "1234567890aaaa" |
| 46 | (propertize "12345678901234567890" 'xxx 25))) | 46 | (propertize "12345678901234567890" 'xxx 25))) |
| 47 | "1234567890")) | 47 | "1234567890")) |
| 48 | (should (ert-equal-including-properties | 48 | (should (equal-including-properties |
| 49 | (format "%.10s" | 49 | (format "%.10s" |
| 50 | (concat "123456789" | 50 | (concat "123456789" |
| 51 | (propertize "12345678901234567890" 'xxx 25))) | 51 | (propertize "12345678901234567890" 'xxx 25))) |
| 52 | #("1234567891" 9 10 (xxx 25)))) | 52 | #("1234567891" 9 10 (xxx 25)))) |
| 53 | 53 | ||
| 54 | ;; Bug #23859 | 54 | ;; Bug #23859 |
| 55 | (should (ert-equal-including-properties | 55 | (should (equal-including-properties |
| 56 | (format "%4s" (propertize "hi" 'face 'bold)) | 56 | (format "%4s" (propertize "hi" 'face 'bold)) |
| 57 | #(" hi" 2 4 (face bold)))) | 57 | #(" hi" 2 4 (face bold)))) |
| 58 | 58 | ||
| 59 | ;; Bug #23897 | 59 | ;; Bug #23897 |
| 60 | (should (ert-equal-including-properties | 60 | (should (equal-including-properties |
| 61 | (format "%s" (concat (propertize "01234" 'face 'bold) "56789")) | 61 | (format "%s" (concat (propertize "01234" 'face 'bold) "56789")) |
| 62 | #("0123456789" 0 5 (face bold)))) | 62 | #("0123456789" 0 5 (face bold)))) |
| 63 | (should (ert-equal-including-properties | 63 | (should (equal-including-properties |
| 64 | (format "%s" (concat (propertize "01" 'face 'bold) | 64 | (format "%s" (concat (propertize "01" 'face 'bold) |
| 65 | (propertize "23" 'face 'underline) | 65 | (propertize "23" 'face 'underline) |
| 66 | "45")) | 66 | "45")) |
| @@ -68,63 +68,63 @@ | |||
| 68 | ;; The last property range is extended to include padding on the | 68 | ;; The last property range is extended to include padding on the |
| 69 | ;; right, but the first range is not extended to the left to include | 69 | ;; right, but the first range is not extended to the left to include |
| 70 | ;; padding on the left! | 70 | ;; padding on the left! |
| 71 | (should (ert-equal-including-properties | 71 | (should (equal-including-properties |
| 72 | (format "%12s" (concat (propertize "01234" 'face 'bold) "56789")) | 72 | (format "%12s" (concat (propertize "01234" 'face 'bold) "56789")) |
| 73 | #(" 0123456789" 2 7 (face bold)))) | 73 | #(" 0123456789" 2 7 (face bold)))) |
| 74 | (should (ert-equal-including-properties | 74 | (should (equal-including-properties |
| 75 | (format "%-12s" (concat (propertize "01234" 'face 'bold) "56789")) | 75 | (format "%-12s" (concat (propertize "01234" 'face 'bold) "56789")) |
| 76 | #("0123456789 " 0 5 (face bold)))) | 76 | #("0123456789 " 0 5 (face bold)))) |
| 77 | (should (ert-equal-including-properties | 77 | (should (equal-including-properties |
| 78 | (format "%10s" (concat (propertize "01" 'face 'bold) | 78 | (format "%10s" (concat (propertize "01" 'face 'bold) |
| 79 | (propertize "23" 'face 'underline) | 79 | (propertize "23" 'face 'underline) |
| 80 | "45")) | 80 | "45")) |
| 81 | #(" 012345" 4 6 (face bold) 6 8 (face underline)))) | 81 | #(" 012345" 4 6 (face bold) 6 8 (face underline)))) |
| 82 | (should (ert-equal-including-properties | 82 | (should (equal-including-properties |
| 83 | (format "%-10s" (concat (propertize "01" 'face 'bold) | 83 | (format "%-10s" (concat (propertize "01" 'face 'bold) |
| 84 | (propertize "23" 'face 'underline) | 84 | (propertize "23" 'face 'underline) |
| 85 | "45")) | 85 | "45")) |
| 86 | #("012345 " 0 2 (face bold) 2 4 (face underline)))) | 86 | #("012345 " 0 2 (face bold) 2 4 (face underline)))) |
| 87 | (should (ert-equal-including-properties | 87 | (should (equal-including-properties |
| 88 | (format "%-10s" (concat (propertize "01" 'face 'bold) | 88 | (format "%-10s" (concat (propertize "01" 'face 'bold) |
| 89 | (propertize "23" 'face 'underline) | 89 | (propertize "23" 'face 'underline) |
| 90 | (propertize "45" 'face 'italic))) | 90 | (propertize "45" 'face 'italic))) |
| 91 | #("012345 " | 91 | #("012345 " |
| 92 | 0 2 (face bold) 2 4 (face underline) 4 10 (face italic)))) | 92 | 0 2 (face bold) 2 4 (face underline) 4 10 (face italic)))) |
| 93 | ;; Bug #38191 | 93 | ;; Bug #38191 |
| 94 | (should (ert-equal-including-properties | 94 | (should (equal-including-properties |
| 95 | (format (propertize "‘foo’ %s bar" 'face 'bold) "xxx") | 95 | (format (propertize "‘foo’ %s bar" 'face 'bold) "xxx") |
| 96 | #("‘foo’ xxx bar" 0 13 (face bold)))) | 96 | #("‘foo’ xxx bar" 0 13 (face bold)))) |
| 97 | ;; Bug #32404 | 97 | ;; Bug #32404 |
| 98 | (should (ert-equal-including-properties | 98 | (should (equal-including-properties |
| 99 | (format (concat (propertize "%s" 'face 'bold) | 99 | (format (concat (propertize "%s" 'face 'bold) |
| 100 | "" | 100 | "" |
| 101 | (propertize "%s" 'face 'error)) | 101 | (propertize "%s" 'face 'error)) |
| 102 | "foo" "bar") | 102 | "foo" "bar") |
| 103 | #("foobar" 0 3 (face bold) 3 6 (face error)))) | 103 | #("foobar" 0 3 (face bold) 3 6 (face error)))) |
| 104 | (should (ert-equal-including-properties | 104 | (should (equal-including-properties |
| 105 | (format (concat "%s" (propertize "%s" 'face 'error)) "foo" "bar") | 105 | (format (concat "%s" (propertize "%s" 'face 'error)) "foo" "bar") |
| 106 | #("foobar" 3 6 (face error)))) | 106 | #("foobar" 3 6 (face error)))) |
| 107 | (should (ert-equal-including-properties | 107 | (should (equal-including-properties |
| 108 | (format (concat "%s " (propertize "%s" 'face 'error)) "foo" "bar") | 108 | (format (concat "%s " (propertize "%s" 'face 'error)) "foo" "bar") |
| 109 | #("foo bar" 4 7 (face error)))) | 109 | #("foo bar" 4 7 (face error)))) |
| 110 | ;; Bug #46317 | 110 | ;; Bug #46317 |
| 111 | (let ((s (propertize "X" 'prop "val"))) | 111 | (let ((s (propertize "X" 'prop "val"))) |
| 112 | (should (ert-equal-including-properties | 112 | (should (equal-including-properties |
| 113 | (format (concat "%3s/" s) 12) | 113 | (format (concat "%3s/" s) 12) |
| 114 | #(" 12/X" 4 5 (prop "val")))) | 114 | #(" 12/X" 4 5 (prop "val")))) |
| 115 | (should (ert-equal-including-properties | 115 | (should (equal-including-properties |
| 116 | (format (concat "%3S/" s) 12) | 116 | (format (concat "%3S/" s) 12) |
| 117 | #(" 12/X" 4 5 (prop "val")))) | 117 | #(" 12/X" 4 5 (prop "val")))) |
| 118 | (should (ert-equal-including-properties | 118 | (should (equal-including-properties |
| 119 | (format (concat "%3d/" s) 12) | 119 | (format (concat "%3d/" s) 12) |
| 120 | #(" 12/X" 4 5 (prop "val")))) | 120 | #(" 12/X" 4 5 (prop "val")))) |
| 121 | (should (ert-equal-including-properties | 121 | (should (equal-including-properties |
| 122 | (format (concat "%-3s/" s) 12) | 122 | (format (concat "%-3s/" s) 12) |
| 123 | #("12 /X" 4 5 (prop "val")))) | 123 | #("12 /X" 4 5 (prop "val")))) |
| 124 | (should (ert-equal-including-properties | 124 | (should (equal-including-properties |
| 125 | (format (concat "%-3S/" s) 12) | 125 | (format (concat "%-3S/" s) 12) |
| 126 | #("12 /X" 4 5 (prop "val")))) | 126 | #("12 /X" 4 5 (prop "val")))) |
| 127 | (should (ert-equal-including-properties | 127 | (should (equal-including-properties |
| 128 | (format (concat "%-3d/" s) 12) | 128 | (format (concat "%-3d/" s) 12) |
| 129 | #("12 /X" 4 5 (prop "val")))))) | 129 | #("12 /X" 4 5 (prop "val")))))) |
| 130 | 130 | ||