summaryrefslogtreecommitdiff
path: root/rust-mode-tests.el
diff options
context:
space:
mode:
authorNathan Moreau <nathan.moreau@m4x.org>2019-11-18 11:15:09 +0100
committerGitHub <noreply@github.com>2019-11-18 11:15:09 +0100
commit4fd637c06b27c74df2e8080e832b8bd80a55be81 (patch)
treee7a187763b156e2a7392345702afb945be7196cf /rust-mode-tests.el
parent6a5725328a155e12fee567de03a4625e3eddac26 (diff)
downloadrust-mode-4fd637c06b27c74df2e8080e832b8bd80a55be81.tar.gz
rust-insert-dbg: handle the case of string literals. (#342)
Diffstat (limited to 'rust-mode-tests.el')
-rw-r--r--rust-mode-tests.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index b234771..e2e1218 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -245,10 +245,6 @@ fn bar() { }"
/// even more.
fn bar() { }" 14 85))
-(defun test-dbg-wrap (initial expected position &optional end)
- (with-temp-buffer
- (insert initial)))
-
(defun test-auto-fill (initial position inserted expected)
(rust-test-manip-code
initial
@@ -3186,6 +3182,13 @@ impl Two<'a> {
(ert-deftest rust-test-dbg-uwnrap-on-dbg-start ()
(rust-test-dbg-unwrap 13))
+(ert-deftest rust-test-dbg-unwrap-inside-string-literal ()
+ (rust-test-manip-code
+ "let x = \"foo, bar\"";"
+ 15
+ #'rust-dbg-wrap-or-unwrap
+ "let x = dbg!(\"foo, bar\")"))
+
(when (executable-find rust-cargo-bin)
(ert-deftest rust-test-project-located ()
(lexical-let* ((test-dir (expand-file-name "test-project/" default-directory))