diff options
author | Bozhidar Batsov <bozhidar@batsov.com> | 2018-01-14 20:15:06 +0200 |
---|---|---|
committer | Bozhidar Batsov <bozhidar@batsov.com> | 2018-01-14 20:15:06 +0200 |
commit | 2db31b0069caf4331100207948ca2bcbbf217dc5 (patch) | |
tree | f7a74d223d634802eaf8b460c15d7dc862522d82 /test | |
parent | 3f7608f1a7024b1b2861d803e0e4254a7f9f56da (diff) |
[Fix #2161] Add new interactive command `cider-eval-defun-to-point`
It evaluates the current top-level form up to the point. You can think of this
as a poor man's contextual evaluation.
The command is bound by default to `C-c C-v (C-)z` in `cider-mode`.
Diffstat (limited to 'test')
-rw-r--r-- | test/cider-interaction-tests.el | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/cider-interaction-tests.el b/test/cider-interaction-tests.el index 3aea9450..46ac0c75 100644 --- a/test/cider-interaction-tests.el +++ b/test/cider-interaction-tests.el @@ -102,3 +102,21 @@ (with-temp-buffer (clojure-mode) (expect (cider-interactive-eval "(+ 1)") :not :to-throw))))) + +(describe "cider--calculate-opening-delimiters" + (it "returns the right opening delimiters" + (with-temp-buffer + (clojure-mode) + (insert "(let [a 1] (let [b 2] (+ a b)))") + (backward-char 2) + (expect (cider--calculate-opening-delimiters) :to-equal '(40 40))))) + +(describe "cider--matching-delimiter" + (it "returns the right closing delimiter" + (expect (cider--matching-delimiter ?\() :to-equal ?\)) + (expect (cider--matching-delimiter ?\{) :to-equal ?\}) + (expect (cider--matching-delimiter ?\[) :to-equal ?\])) + (it "returns the right opening delimiter" + (expect (cider--matching-delimiter ?\)) :to-equal ?\() + (expect (cider--matching-delimiter ?\}) :to-equal ?\{) + (expect (cider--matching-delimiter ?\]) :to-equal ?\[))) |