-
-
Notifications
You must be signed in to change notification settings - Fork 195
/
smartparens-haskell-test.el
54 lines (47 loc) · 1.72 KB
/
smartparens-haskell-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
(require 'haskell)
(require 'smartparens-haskell)
;; #710
(ert-deftest sp-test-haskell-allow-deleting-quote-at-end-of-symbol ()
(sp-test-with-temp-buffer "myFunction'|"
(haskell-mode)
(smartparens-strict-mode 1)
(sp-backward-delete-char)
(sp-buffer-equals "myFunction|")))
;; #710
(ert-deftest sp-test-haskell-ignore-apostrophe-when-looking-for-sexp-when-it-is-used-as-suffix ()
(sp-test-with-temp-buffer "test c d = myFunction' c + (myFunct|ion' d)"
(haskell-mode)
(sp-get (sp-get-sexp)
(should (equal :op "(")))
(sp-get (sp-get-enclosing-sexp)
(should (equal :op "(")))))
;; #710
(ert-deftest sp-test-haskell-splice-sexp-when-there-is-trailing-quote ()
(sp-test-with-temp-buffer "test c d = myFunction' c + (myFunct|ion' d)"
(haskell-mode)
(sp-splice-sexp)
(sp-buffer-equals "test c d = myFunction' c + myFunct|ion' d")))
;; #710
(ert-deftest sp-test-haskell-unwrap-sexp-when-there-is-trailing-quote ()
(sp-test-with-temp-buffer "test c d = myFunction' c + (myFunct|ion' d)"
(haskell-mode)
(sp-unwrap-sexp)
(sp-buffer-equals "test c d = myFunction' c + myFunct|ion' d")))
;; #710
(ert-deftest sp-test-haskell-splice-char-sexp ()
(sp-test-with-temp-buffer "'|a'"
(haskell-mode)
(sp-splice-sexp)
(sp-buffer-equals "|a")))
;; #710
(ert-deftest sp-test-haskell-unwrap-char-sexp ()
(sp-test-with-temp-buffer "'|a'"
(haskell-mode)
(sp-unwrap-sexp)
(sp-buffer-equals "|a")))
(ert-deftest sp-test-haskell-sp-backward-kill-words-respects-pairs-in-strict-mode ()
(sp-test-with-temp-buffer "foo a = foldr (+) []| b"
(haskell-mode)
(smartparens-strict-mode 1)
(sp-backward-kill-word 1)
(sp-buffer-equals "foo a = | (+) [] b")))