-
-
Notifications
You must be signed in to change notification settings - Fork 194
/
Copy pathsmartparens-text-test.el
57 lines (50 loc) · 1.66 KB
/
smartparens-text-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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
(require 'smartparens-text)
(require 'message)
(ert-deftest sp-test-text-mode-insert-emoticon-smiley-strict-mode ()
"#713"
(sp-test-with-temp-buffer "|"
(message-mode)
(smartparens-strict-mode 1)
(execute-kbd-macro ":)")
(sp-buffer-equals ":)")))
(ert-deftest sp-test-text-mode-insert-emoticon-smiley-with-nose-strict-mode ()
"#713"
(sp-test-with-temp-buffer "|"
(message-mode)
(smartparens-strict-mode 1)
(execute-kbd-macro ":-)")
(sp-buffer-equals ":-)")))
(ert-deftest sp-test-text-mode-insert-emoticon-frowny-strict-mode ()
"#713"
(sp-test-with-temp-buffer "|"
(message-mode)
(smartparens-strict-mode 1)
(execute-kbd-macro ":(")
(sp-buffer-equals ":(")))
(ert-deftest sp-test-text-mode-insert-emoticon-frowny-with-nose-strict-mode ()
"#713"
(sp-test-with-temp-buffer "|"
(message-mode)
(smartparens-strict-mode 1)
(execute-kbd-macro ":-(")
(sp-buffer-equals ":-(")))
(ert-deftest sp-test-text-mode-skip-emoticon-when-navigating ()
"#713"
(sp-test-with-temp-buffer "|(foo :) bar :( baz)"
(message-mode)
(sp-forward-sexp)
(sp-buffer-equals "(foo :) bar :( baz)|")))
(ert-deftest sp-test-text-mode-wrap-emoticons-strict-mode ()
"#713"
(sp-test-with-temp-buffer "| foo :) bar :( baz M"
(message-mode)
(smartparens-strict-mode 1)
(execute-kbd-macro "(")
(sp-buffer-equals "(| foo :) bar :( baz M)")))
(ert-deftest sp-test-text-mode-kill-region-with-emoticons-strict-mode ()
"#713"
(sp-test-with-temp-buffer "foo | foo :) bar :( baz M"
(message-mode)
(smartparens-strict-mode 1)
(call-interactively 'sp-kill-region)
(sp-buffer-equals "foo |")))