|
| 1 | +;;; inf-clojure-tests.el --- Tests for Inf-Clojure -*- lexical-binding: t; -*- |
| 2 | +;; |
| 3 | +;; Copyright © 2014-2018 Bozhidar Batsov |
| 4 | + |
| 5 | +;; Authors: Bozhidar Batsov <[email protected]> |
| 6 | +;; Andrea Richiardi <[email protected]> |
| 7 | +;; URL: http://github.com/clojure-emacs/inf-clojure |
| 8 | +;; Keywords: processes, clojure |
| 9 | +;; Package-Requires: ((emacs "24.4") (clojure-mode "5.3")) |
| 10 | + |
| 11 | +;; This file is part of GNU Emacs. |
| 12 | + |
| 13 | +;; GNU Emacs is free software: you can redistribute it and/or modify |
| 14 | +;; it under the terms of the GNU General Public License as published by |
| 15 | +;; the Free Software Foundation, either version 3 of the License, or |
| 16 | +;; (at your option) any later version. |
| 17 | + |
| 18 | +;; GNU Emacs is distributed in the hope that it will be useful, |
| 19 | +;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 | +;; GNU General Public License for more details. |
| 22 | + |
| 23 | +;; You should have received a copy of the GNU General Public License |
| 24 | +;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
| 25 | + |
| 26 | +;;; Commentary: |
| 27 | +;; |
| 28 | +;; Code completion using alexander-yakushev/compliment. |
| 29 | + |
| 30 | +;;; Code: |
| 31 | + |
| 32 | +;; Tests for inf-clojure.el |
| 33 | + |
| 34 | +(message "Running tests on Emacs %s" emacs-version) |
| 35 | + |
| 36 | +(require 'ert-x) |
| 37 | +(require 'inf-clojure) |
| 38 | + |
| 39 | +(cl-defmacro ict-with-minor-mode-buffer ((&rest args) initial-contents &body body) |
| 40 | + (declare (indent 2)) |
| 41 | + `(ert-with-test-buffer (,@args) |
| 42 | + (inf-clojure-minor-mode) |
| 43 | + (insert ,initial-contents) |
| 44 | + ,@body)) |
| 45 | + |
| 46 | +(defun ict-bounds-string (bounds) |
| 47 | + (buffer-substring (car bounds) (cdr bounds))) |
| 48 | + |
| 49 | +(ert-deftest clojure-expr-break-chars-tests () |
| 50 | + (ict-with-minor-mode-buffer |
| 51 | + (:name "clojure-expr-break-chars") |
| 52 | + "plain-text" |
| 53 | + (should |
| 54 | + (string-equal |
| 55 | + "plain-text" |
| 56 | + (ict-bounds-string (inf-clojure-completion-bounds-of-expr-at-point)))) |
| 57 | + |
| 58 | + (erase-buffer) |
| 59 | + (insert "@text-with-deref") |
| 60 | + (should |
| 61 | + (string-equal |
| 62 | + "text-with-deref" |
| 63 | + (ict-bounds-string (inf-clojure-completion-bounds-of-expr-at-point))))) |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + ) |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | +;;; inf-clojure-tests.el ends here |
0 commit comments