Add test for align-regexp

* test/lisp/align-tests.el (align-regexp): New test.
* test/lisp/align-resources/align-regexp.erts: New file.

* test/lisp/align-resources/c-mode.erts: Add new test case.
This commit is contained in:
Stefan Kangas 2023-08-03 11:56:42 +02:00
parent 7b30e11b2a
commit 508eaa3290
3 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1,13 @@
Name: align function declaration
=-=
Fred (123) 456-7890
Alice (123) 456-7890
Mary-Anne (123) 456-7890
Joe (123) 456-7890
=-=
Fred (123) 456-7890
Alice (123) 456-7890
Mary-Anne (123) 456-7890
Joe (123) 456-7890
=-=-=

View file

@ -9,3 +9,15 @@ int
main (int argc,
char *argv[]);
=-=-=
Name: example from Commentary
=-=
int a = 1;
short foo = 2;
double blah = 4;
=-=
int a = 1;
short foo = 2;
double blah = 4;
=-=-=

View file

@ -25,6 +25,8 @@
(require 'ert-x)
(require 'align)
;;;; align
(defun test-align-transform-fun (function)
(lambda ()
(funcall function)
@ -56,6 +58,15 @@
(ert-test-erts-file (ert-resource-file "conf-toml-mode.erts")
(test-align-transform-fun #'conf-toml-mode))))
;;;; align-regexp
(ert-deftest align-regexp ()
(let ((indent-tabs-mode nil))
(ert-test-erts-file (ert-resource-file "align-regexp.erts")
(lambda ()
(align-regexp (point-min) (point-max)
"\\(\\s-*\\)(")))))
(provide 'align-tests)
;;; align-tests.el ends here