diff options
| author | Po Lu | 2024-01-28 16:55:33 +0800 |
|---|---|---|
| committer | Po Lu | 2024-01-28 16:58:28 +0800 |
| commit | d664814a8d40da63f1906218b73aec62f2cd4d18 (patch) | |
| tree | be58cd21e9d14adc44e55c0126480acf9cbbdae0 /test/lisp | |
| parent | 78fc49407b8ef8ec649fe70fcce09101801dbc05 (diff) | |
| download | emacs-d664814a8d40da63f1906218b73aec62f2cd4d18.tar.gz emacs-d664814a8d40da63f1906218b73aec62f2cd4d18.zip | |
; New log-edit tests
* test/lisp/vc/log-edit-tests.el
(log-edit-fill-entry-confinement): Test confinement in various
contrived scenarious.
Diffstat (limited to 'test/lisp')
| -rw-r--r-- | test/lisp/vc/log-edit-tests.el | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/test/lisp/vc/log-edit-tests.el b/test/lisp/vc/log-edit-tests.el index 1a2af716f34..5b555809f4c 100644 --- a/test/lisp/vc/log-edit-tests.el +++ b/test/lisp/vc/log-edit-tests.el | |||
| @@ -134,4 +134,55 @@ lines.")))) | |||
| 134 | * a-very-long-directory-name/another-long-directory-name/and-a-long-file-name.ext | 134 | * a-very-long-directory-name/another-long-directory-name/and-a-long-file-name.ext |
| 135 | \(a-really-long-function-name):")))) | 135 | \(a-really-long-function-name):")))) |
| 136 | 136 | ||
| 137 | (ert-deftest log-edit-fill-entry-confinement () | ||
| 138 | (let (string string1 string2 string3 string4) | ||
| 139 | (setq string | ||
| 140 | ;; This entry is precisely 65 columns in length; | ||
| 141 | ;; log-edit-fill-column should leave it unmodified. | ||
| 142 | "* file2.txt (fun4, fun5, fun6, fun7, fun8, fun9, fun10, fun1134):" | ||
| 143 | string1 | ||
| 144 | ;; This entry is 66 columns in length, and must be filled. | ||
| 145 | "* file2.txt (fun4, fun5, fun6, fun7, fun8, fun9, fun10, fun11345):" | ||
| 146 | string2 | ||
| 147 | ;; The first line of this entry totals 65 columns in length, | ||
| 148 | ;; and should be preserved intact. | ||
| 149 | "* file2.txt (fun4, fun5, fun6, fun7, fun8, fun9, fun10, fun11345) | ||
| 150 | (fun11356):" | ||
| 151 | string3 | ||
| 152 | ;; The first defun in this entry is a file name that brings | ||
| 153 | ;; the total to 40 columns in length and should be preserved | ||
| 154 | ;; intact. | ||
| 155 | "* file2.txt (abcdefghijklmnopqrstuvwxyz) | ||
| 156 | (ABC):" | ||
| 157 | string4 | ||
| 158 | ;; The first defun brings that total to 41, and should be | ||
| 159 | ;; placed on the next line. | ||
| 160 | "* file2.txt (abcdefghijklmnopqrstuvwxyz):") | ||
| 161 | (with-temp-buffer | ||
| 162 | (insert string) | ||
| 163 | (let ((fill-column 64)) (log-edit-fill-entry)) | ||
| 164 | (should (equal (buffer-string) string)) | ||
| 165 | (erase-buffer) | ||
| 166 | (insert string1) | ||
| 167 | (let ((fill-column 64)) (log-edit-fill-entry)) | ||
| 168 | (should (equal (buffer-string) | ||
| 169 | "* file2.txt (fun4, fun5, fun6, fun7, fun8, fun9, fun10) | ||
| 170 | (fun11345):")) | ||
| 171 | (erase-buffer) | ||
| 172 | (insert string2) | ||
| 173 | (let ((fill-column 64)) (log-edit-fill-entry)) | ||
| 174 | (should (equal (buffer-string) string2)) | ||
| 175 | (erase-buffer) | ||
| 176 | (insert string3) | ||
| 177 | (let ((fill-column 39)) (log-edit-fill-entry)) | ||
| 178 | (should (equal (buffer-string) string3)) | ||
| 179 | (erase-buffer) | ||
| 180 | (insert string4) | ||
| 181 | (let ((fill-column 39)) (log-edit-fill-entry)) | ||
| 182 | (should (equal (buffer-string) | ||
| 183 | ;; There is whitespace after "file2.txt" which | ||
| 184 | ;; should not be erased! | ||
| 185 | "* file2.txt | ||
| 186 | (abcdefghijklmnopqrstuvwxyz):"))))) | ||
| 187 | |||
| 137 | ;;; log-edit-tests.el ends here | 188 | ;;; log-edit-tests.el ends here |