-
-
Notifications
You must be signed in to change notification settings - Fork 195
/
smartparens-settings-sp-pair-test.el
36 lines (32 loc) · 1.66 KB
/
smartparens-settings-sp-pair-test.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
(ert-deftest sp-test-add-global-pair ()
(let ((sp-pairs nil))
(sp-pair "(" ")")
(should (equal sp-pairs '((t (:open "(" :close ")" :actions (wrap insert autoskip navigate))))))))
(ert-deftest sp-test-add-global-pair-with-a-when-condition ()
(let ((sp-pairs nil))
(sp-pair "(" ")" :when '(ignore))
(should (equal sp-pairs '((t (:open "(" :close ")"
:actions (wrap insert autoskip navigate)
:when (ignore))))))))
(ert-deftest sp-test-remove-global-pair-when-condition ()
(let ((sp-pairs '((t (:open "(" :close ")"
:actions (wrap insert autoskip navigate)
:when (ignore))))))
(sp-pair "(" ")" :when nil)
(should (equal sp-pairs '((t (:open "(" :close ")"
:actions (wrap insert autoskip navigate)
:when nil)))))))
(ert-deftest sp-test-replace-global-pair-actions ()
(let ((sp-pairs '((t (:open "(" :close ")"
:actions (wrap insert autoskip navigate)
:when (ignore))))))
(sp-pair "(" ")" :actions '(wrap insert))
(should (equal sp-pairs '((t (:open "(" :close ")"
:actions (wrap insert)
:when nil)))))))
(ert-deftest sp-test-remove-global-pair-nonexisting-when-condition ()
(let ((sp-pairs '((t (:open "(" :close ")"
:actions (wrap insert autoskip navigate))))))
(sp-pair "(" ")" :when nil)
(should (equal sp-pairs '((t (:open "(" :close ")"
:actions (wrap insert autoskip navigate))))))))