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:
13
test/lisp/align-resources/align-regexp.erts
Normal file
13
test/lisp/align-resources/align-regexp.erts
Normal 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
|
||||
=-=-=
|
||||
@@ -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;
|
||||
=-=-=
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user