summaryrefslogtreecommitdiff
path: root/rust-mode-tests.el
diff options
context:
space:
mode:
authorSibi Prabakaran <sibi@psibi.in>2023-08-05 21:28:09 +0530
committerGitHub <noreply@github.com>2023-08-05 21:28:09 +0530
commitfac7d284d24080d0886c47d20bbddbf60ec51511 (patch)
tree421bcf9a52b6cd719b4d1cf734d0bea09db92fbf /rust-mode-tests.el
parent601824cf552d09db62f0cef42c00dc85bd728b04 (diff)
parent527e375ac18bc0742f7c62193c145c9e00f928e5 (diff)
downloadrust-mode-fac7d284d24080d0886c47d20bbddbf60ec51511.tar.gz
Merge pull request #500 from micl2e2/master
Eliminate "Containing expression ends prematurely" error
Diffstat (limited to 'rust-mode-tests.el')
-rw-r--r--rust-mode-tests.el20
1 files changed, 19 insertions, 1 deletions
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index 7b791b6..5c6d547 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -3449,7 +3449,8 @@ impl Two<'a> {
"Foo" font-lock-type-face
"in" font-lock-keyword-face)))
-(ert-deftest rust-test-dbg-wrap-symbol ()
+(ert-deftest rust-test-dbg-wrap-sexp ()
+ "a valid sexp ahead of current pos"
(rust-test-manip-code
"let x = add(first, second);"
15
@@ -3457,6 +3458,23 @@ impl Two<'a> {
"let x = add(dbg!(first), second);"
24))
+(ert-deftest rust-test-dbg-wrap-sexp-fallback ()
+ "a invalid sexp ahead of current pos"
+ ;; inside
+ (rust-test-manip-code
+ "if let Ok(val) = may_val {}"
+ 27
+ #'rust-dbg-wrap-or-unwrap
+ "if let Ok(val) = may_val {dbg!()}"
+ 32)
+ ;; before
+ (rust-test-manip-code
+ "let a = {}"
+ 9
+ #'rust-dbg-wrap-or-unwrap
+ "let a = dbg!({})"
+ 17))
+
(ert-deftest rust-test-dbg-wrap-empty-line ()
(rust-test-manip-code
"let a = 1;