diff options
Diffstat (limited to 'test/lisp/simple-tests.el')
| -rw-r--r-- | test/lisp/simple-tests.el | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el index 08e81a7fefb..d9f059c8fc2 100644 --- a/test/lisp/simple-tests.el +++ b/test/lisp/simple-tests.el | |||
| @@ -214,6 +214,40 @@ | |||
| 214 | (remove-hook 'post-self-insert-hook inc)))) | 214 | (remove-hook 'post-self-insert-hook inc)))) |
| 215 | 215 | ||
| 216 | 216 | ||
| 217 | ;;; `delete-indentation' | ||
| 218 | (ert-deftest simple-delete-indentation-no-region () | ||
| 219 | "delete-indentation works when no mark is set." | ||
| 220 | ;; interactive \r returns nil for BEG END args | ||
| 221 | (unwind-protect | ||
| 222 | (with-temp-buffer | ||
| 223 | (insert (concat "zero line \n" | ||
| 224 | "first line \n" | ||
| 225 | "second line")) | ||
| 226 | (delete-indentation) | ||
| 227 | (should (string-equal | ||
| 228 | (buffer-string) | ||
| 229 | (concat "zero line \n" | ||
| 230 | "first line second line"))) | ||
| 231 | ))) | ||
| 232 | |||
| 233 | (ert-deftest simple-delete-indentation-inactive-region () | ||
| 234 | "delete-indentation ignores inactive region." | ||
| 235 | ;; interactive \r returns non-nil for BEG END args | ||
| 236 | (unwind-protect | ||
| 237 | (with-temp-buffer | ||
| 238 | (insert (concat "zero line \n" | ||
| 239 | "first line \n" | ||
| 240 | "second line")) | ||
| 241 | (push-mark (point-min) t t) | ||
| 242 | (deactivate-mark) | ||
| 243 | (delete-indentation) | ||
| 244 | (should (string-equal | ||
| 245 | (buffer-string) | ||
| 246 | (concat "zero line \n" | ||
| 247 | "first line second line"))) | ||
| 248 | ))) | ||
| 249 | |||
| 250 | |||
| 217 | ;;; `delete-trailing-whitespace' | 251 | ;;; `delete-trailing-whitespace' |
| 218 | (ert-deftest simple-delete-trailing-whitespace--bug-21766 () | 252 | (ert-deftest simple-delete-trailing-whitespace--bug-21766 () |
| 219 | "Test bug#21766: delete-whitespace sometimes deletes non-whitespace." | 253 | "Test bug#21766: delete-whitespace sometimes deletes non-whitespace." |