-
-
Notifications
You must be signed in to change notification settings - Fork 195
/
smartparens-get-stringlike-expression-elisp-test.el
30 lines (29 loc) · 3.58 KB
/
smartparens-get-stringlike-expression-elisp-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
(defun sp-test--stringlike-expression-parse-in-elisp (initial result &optional back)
(sp-test-with-temp-elisp-buffer initial
(should (equal (sp-get-stringlike-expression back) result))))
(ert-deftest sp-test-get-stringlike-expression-elisp ()
"Test basic stringlike expressions in `emacs-lisp-mode'."
(sp-test--stringlike-expression-parse-in-elisp "|foo \"bar\" baz \"quux\" bux" '(:beg 5 :end 10 :op "\"" :cl "\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "foo |\"bar\" baz \"quux\" bux" '(:beg 5 :end 10 :op "\"" :cl "\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "foo \"|bar\" baz \"quux\" bux" '(:beg 5 :end 10 :op "\"" :cl "\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "foo \"ba|r\" baz \"quux\" bux" '(:beg 5 :end 10 :op "\"" :cl "\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "foo \"bar|\" baz \"quux\" bux" '(:beg 5 :end 10 :op "\"" :cl "\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "foo \"bar\"| baz \"quux\" bux" '(:beg 15 :end 21 :op "\"" :cl "\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "foo \"bar\" b|az \"quux\" bux" '(:beg 15 :end 21 :op "\"" :cl "\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "foo \"bar\" baz| \"quux\" bux" '(:beg 15 :end 21 :op "\"" :cl "\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "foo \"bar\" baz |\"quux\" bux" '(:beg 15 :end 21 :op "\"" :cl "\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "foo \"bar\" baz \"qu|ux\" bux" '(:beg 15 :end 21 :op "\"" :cl "\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "foo \"bar\" baz \"quux|\" bux" '(:beg 15 :end 21 :op "\"" :cl "\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "|foo \"b\\\"ar\" baz \"q\\\"uux\" bux" '(:beg 5 :end 12 :op "\"" :cl "\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "foo |\"b\\\"ar\" baz \"q\\\"uux\" bux" '(:beg 5 :end 12 :op "\"" :cl "\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "foo \"b\\\"a|r\" baz \"q\\\"uux\" bux" '(:beg 5 :end 12 :op "\"" :cl "\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "foo \"b\\\"ar\"| baz \"q\\\"uux\" bux" '(:beg 17 :end 25 :op "\"" :cl "\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "foo \"b\\\"ar\" baz |\"q\\\"uux\" bux" '(:beg 17 :end 25 :op "\"" :cl "\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "foo \"b\\\"ar\" baz \"q\\\"uu|x\" bux" '(:beg 17 :end 25 :op "\"" :cl "\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "|foo \\\"bar\\\" baz bam \\\"quux\\\"" '(:beg 5 :end 12 :op "\\\"" :cl "\\\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "foo |\\\"bar\\\" baz bam \\\"quux\\\"" '(:beg 5 :end 12 :op "\\\"" :cl "\\\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "foo \\\"b|ar\\\" baz bam \\\"quux\\\"" '(:beg 5 :end 12 :op "\\\"" :cl "\\\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "foo \\\"bar\\\"| baz bam \\\"quux\\\"" '(:beg 21 :end 29 :op "\\\"" :cl "\\\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "foo \\\"bar\\\" baz bam |\\\"quux\\\"" '(:beg 21 :end 29 :op "\\\"" :cl "\\\"" :prefix "" :suffix ""))
(sp-test--stringlike-expression-parse-in-elisp "foo \\\"bar\\\" baz bam \\\"quu|x\\\"" '(:beg 21 :end 29 :op "\\\"" :cl "\\\"" :prefix "" :suffix ""))
)