From 4fd637c06b27c74df2e8080e832b8bd80a55be81 Mon Sep 17 00:00:00 2001 From: Nathan Moreau Date: Mon, 18 Nov 2019 11:15:09 +0100 Subject: rust-insert-dbg: handle the case of string literals. (#342) --- rust-mode-tests.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'rust-mode-tests.el') 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)) -- cgit v1.2.3