|
| 1 | +;;; clojure-mode-sexp-test.el --- Clojure Mode: sexp tests -*- lexical-binding: t; -*- |
| 2 | + |
| 3 | +;; Copyright (C) 2015 Artur Malabarba <artur@endlessparentheses.com> |
| 4 | + |
| 5 | +;; This file is not part of GNU Emacs. |
| 6 | + |
| 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. |
| 11 | + |
| 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. |
| 16 | + |
| 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/>. |
| 19 | + |
| 20 | +;;; Code: |
| 21 | + |
| 22 | +(require 'clojure-mode) |
| 23 | +(require 'ert) |
| 24 | + |
| 25 | +(ert-deftest test-sexp () |
| 26 | + (with-temp-buffer |
| 27 | + (insert "^String #macro ^dynamic reverse") |
| 28 | + (clojure-mode) |
| 29 | + (clojure-backward-logical-sexp 1) |
| 30 | + (should (looking-at-p "\\^String \\#macro \\^dynamic reverse")) |
| 31 | + (clojure-forward-logical-sexp 1) |
| 32 | + (should (looking-back "\\^String \\#macro \\^dynamic reverse")) |
| 33 | + (insert " ^String biverse inverse") |
| 34 | + (clojure-backward-logical-sexp 1) |
| 35 | + (should (looking-at-p "inverse")) |
| 36 | + (clojure-backward-logical-sexp 2) |
| 37 | + (should (looking-at-p "\\^String \\#macro \\^dynamic reverse")) |
| 38 | + (clojure-forward-logical-sexp 2) |
| 39 | + (should (looking-back "\\^String biverse")) |
| 40 | + (clojure-backward-logical-sexp 1) |
| 41 | + (should (looking-at-p "\\^String biverse")))) |
| 42 | + |
| 43 | +(provide 'clojure-mode-sexp-test) |
| 44 | + |
| 45 | +;;; clojure-mode-sexp-test.el ends here |
0 commit comments