1 ;;; adjust-parens-tests.el --- Tests of adjust-parens package
3 ;; Copyright (C) 2013 Free Software Foundation, Inc.
5 ;; Author: Barry O'Reilly <gundaetiapo@gmail.com>
7 ;; This program is free software; you can redistribute it and/or modify
8 ;; it under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation, either version 3 of the License, or
10 ;; (at your option) any later version.
12 ;; This program is distributed in the hope that it will be useful,
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;; GNU General Public License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
25 (require 'adjust-parens)
27 (defun apt-check-buffer (text-before-point text-after-point)
28 (should (string= text-before-point
29 (buffer-substring-no-properties (point-min)
31 (should (string= text-after-point
32 (buffer-substring-no-properties (point)
35 (ert-deftest apt-near-bob-test ()
39 (lisp-indent-adjust-parens)
40 (apt-check-buffer "(foo\n " ")")))
42 (ert-deftest apt-indent-dedent-test ()
45 (setq indent-tabs-mode nil)
47 "(let ((x 10) (y (some-func 20))))\n"
50 (lisp-indent-adjust-parens)
51 (apt-check-buffer (concat ";;\n"
52 "(let ((x 10) (y (some-func 20)))\n"
55 (lisp-indent-adjust-parens 3)
56 (apt-check-buffer (concat ";;\n"
57 "(let ((x 10) (y (some-func 20\n"
60 (lisp-dedent-adjust-parens 2)
61 (apt-check-buffer (concat ";;\n"
62 "(let ((x 10) (y (some-func 20))\n"
66 ;;; adjust-parens-tests.el ends here