-
-
Notifications
You must be signed in to change notification settings - Fork 194
/
Copy pathsmartparens-barf-test.el
57 lines (51 loc) · 3.08 KB
/
smartparens-barf-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)
(ert-deftest sp-test-sp-forward-barf-sexp-634 ()
(let ((sp-barf-move-point-with-delimiter nil))
(sp-test-with-temp-elisp-buffer "(let ((a 4)\n ;; (fail)\n |(+ 1)\n ))\n"
(call-interactively 'sp-forward-barf-sexp)
(sp-buffer-equals "(let ((a 4))\n ;; (fail)\n (+ 1)\n )\n")
(call-interactively 'sp-forward-barf-sexp)
(sp-buffer-equals "(let ((a 4)))\n;; (fail)\n|(+ 1)\n\n"))))
(ert-deftest sp-test-sp-forward-barf-918-move-point-with-closing-enabled ()
(let ((sp-barf-move-point-with-delimiter t))
(sp-test-with-temp-elisp-buffer "(hello world\n\n | what\n is this)"
(call-interactively 'sp-forward-barf-sexp)
(sp-buffer-equals "(hello world\n\n | what\n is) this")
(call-interactively 'sp-forward-barf-sexp)
(sp-buffer-equals "(hello world\n\n | what)\nis this")
(call-interactively 'sp-forward-barf-sexp)
(sp-buffer-equals "(hello world|)\n\nwhat\nis this"))))
(ert-deftest sp-test-sp-forward-barf-918-move-point-with-closing-disabled ()
(let ((sp-barf-move-point-with-delimiter nil))
(sp-test-with-temp-elisp-buffer "(hello world\n\n | what\n is this)"
(call-interactively 'sp-forward-barf-sexp)
(sp-buffer-equals "(hello world\n\n | what\n is) this")
(call-interactively 'sp-forward-barf-sexp)
(sp-buffer-equals "(hello world\n\n | what)\nis this")
(call-interactively 'sp-forward-barf-sexp)
(sp-buffer-equals "(hello world)\n\n|what\nis this"))))
(ert-deftest sp-test-sp-backward-barf-918-move-point-with-opening-enabled ()
(let ((sp-barf-move-point-with-delimiter t))
(sp-test-with-temp-elisp-buffer "(hello world\n\n | what\n is this)"
(call-interactively 'sp-backward-barf-sexp)
(sp-buffer-equals "hello (world\n\n | what\n is this)")
(call-interactively 'sp-backward-barf-sexp)
(sp-buffer-equals "hello world\n\n(|what\n is this)")
(call-interactively 'sp-backward-barf-sexp)
(sp-buffer-equals "hello world\n\nwhat\n(|is this)"))))
(ert-deftest sp-test-sp-backward-barf-918-move-point-with-opening-enabled-with-prefix ()
(let ((sp-barf-move-point-with-delimiter t))
(sp-test-with-temp-elisp-buffer ",@(hello world\n\n | what\n is this)"
(call-interactively 'sp-backward-barf-sexp)
(sp-buffer-equals "hello ,@(world\n\n | what\n is this)")
(call-interactively 'sp-backward-barf-sexp)
(sp-buffer-equals "hello world\n\n,@(|what\n is this)")
(call-interactively 'sp-backward-barf-sexp)
(sp-buffer-equals "hello world\n\nwhat\n,@(|is this)"))))
(ert-deftest sp-test-sp-backward-barf-918-move-point-with-opening-disabled ()
(let ((sp-barf-move-point-with-delimiter nil))
(sp-test-with-temp-elisp-buffer "(hello world\n\n | what\n is this)"
(call-interactively 'sp-backward-barf-sexp)
(sp-buffer-equals "hello (world\n\n | what\n is this)")
(call-interactively 'sp-backward-barf-sexp)
(sp-buffer-equals "hello world\n\n|(what\n is this)"))))