From: Stefan Kangas Date: Thu, 3 Aug 2023 09:56:42 +0000 (+0200) Subject: Add test for align-regexp X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=508eaa3290963dd0ef07f99263d1171be3a6f85a;p=emacs.git 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. --- diff --git a/test/lisp/align-resources/align-regexp.erts b/test/lisp/align-resources/align-regexp.erts new file mode 100644 index 00000000000..fbbd6d6bd33 --- /dev/null +++ b/test/lisp/align-resources/align-regexp.erts @@ -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 +=-=-= diff --git a/test/lisp/align-resources/c-mode.erts b/test/lisp/align-resources/c-mode.erts index 0a0fa046b34..ecdff507103 100644 --- a/test/lisp/align-resources/c-mode.erts +++ b/test/lisp/align-resources/c-mode.erts @@ -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; +=-=-= diff --git a/test/lisp/align-tests.el b/test/lisp/align-tests.el index dac23ef96d9..a4d9303827f 100644 --- a/test/lisp/align-tests.el +++ b/test/lisp/align-tests.el @@ -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