(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 ""))
  )
