Skip to content

Commit e9c328a

Browse files
yuhan0bbatsov
authored andcommitted
Add tests for paredit interaction
1 parent fb436f6 commit e9c328a

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
;;; clojure-mode-external-interaction-test.el --- Clojure Mode interactions with external packages test suite -*- lexical-binding: t; -*-
2+
3+
;; Copyright (C) 2014-2020 Bozhidar Batsov <[email protected]>
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 'buttercup)
24+
(require 'paredit)
25+
26+
(describe "Interactions with Paredit"
27+
;; reuse existing when-refactoring-it macro
28+
(describe "it should insert a space"
29+
(when-refactoring-it "before lists"
30+
"foo"
31+
"foo ()"
32+
(paredit-mode)
33+
(paredit-open-round))
34+
(when-refactoring-it "before vectors"
35+
"foo"
36+
"foo []"
37+
(paredit-mode)
38+
(paredit-open-square))
39+
(when-refactoring-it "before maps"
40+
"foo"
41+
"foo {}"
42+
(paredit-mode)
43+
(paredit-open-curly))
44+
(when-refactoring-it "before strings"
45+
"foo"
46+
"foo \"\""
47+
(paredit-mode)
48+
(paredit-doublequote))
49+
(when-refactoring-it "after gensym"
50+
"foo#"
51+
"foo# ()"
52+
(paredit-mode)
53+
(paredit-open-round))
54+
(when-refactoring-it "after symbols ending with '"
55+
"foo'"
56+
"foo' ()"
57+
(paredit-mode)
58+
(paredit-open-round)))
59+
(describe "should not insert a space"
60+
(when-refactoring-it "for anonymous fn syntax"
61+
"foo #"
62+
"foo #()"
63+
(paredit-mode)
64+
(paredit-open-round))
65+
(when-refactoring-it "for hash sets"
66+
"foo #"
67+
"foo #{}"
68+
(paredit-mode)
69+
(paredit-open-curly))
70+
(when-refactoring-it "for regexes"
71+
"foo #"
72+
"foo #\"\""
73+
(paredit-mode)
74+
(paredit-doublequote))
75+
(when-refactoring-it "for quoted collections"
76+
"foo '"
77+
"foo '()"
78+
(paredit-mode)
79+
(paredit-open-round))
80+
(when-refactoring-it "for reader conditionals"
81+
"foo #?"
82+
"foo #?()"
83+
(paredit-mode)
84+
(paredit-open-round))))
85+
86+
87+
(provide 'clojure-mode-external-interaction-test)
88+
89+
90+
;;; clojure-mode-external-interaction-test.el ends here

0 commit comments

Comments
 (0)