emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/relint 1ea9b91 05/11: Add tests for ineffective backsla


From: Mattias Engdegård
Subject: [elpa] externals/relint 1ea9b91 05/11: Add tests for ineffective backslash check
Date: Sat, 20 Jun 2020 05:57:40 -0400 (EDT)

branch: externals/relint
commit 1ea9b91bb5c17f3aeac4a2263cd7a68011dc3055
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    Add tests for ineffective backslash check
---
 test/13.elisp    | 17 +++++++++++++++++
 test/13.expected | 17 +++++++++++++++++
 2 files changed, 34 insertions(+)

diff --git a/test/13.elisp b/test/13.elisp
new file mode 100644
index 0000000..4c6fb35
--- /dev/null
+++ b/test/13.elisp
@@ -0,0 +1,17 @@
+;;; Relint test file 13          -*- emacs-lisp -*-
+
+;; Test ineffective backslashes in strings
+
+(defun f1 ()
+  "doc string with \(silly\) bac\kslashes
+\[that we ignore\]"
+  (list
+   "\more \(bad things\)"
+   "long \<string\>
+\(with mistakes\)
+\{and so on\}"
+   "valid: \\ \" \x5e \172 \u1234 \u00000041 \C-x \M-e \ \
+and \a \b \f \n \r \t \v \d \e \s \^P"))
+
+(defun f2 ()
+  (re-search-forward "\$\.x\+\+"))
diff --git a/test/13.expected b/test/13.expected
new file mode 100644
index 0000000..fd69f6f
--- /dev/null
+++ b/test/13.expected
@@ -0,0 +1,17 @@
+13.elisp:9:5: Ineffective string escape `\m'
+13.elisp:9:11: Ineffective string escape `\('
+13.elisp:9:23: Ineffective string escape `\)'
+13.elisp:10:10: Ineffective string escape `\<'
+13.elisp:10:18: Ineffective string escape `\>'
+13.elisp:11:16: Ineffective string escape `\)'
+13.elisp:12:12: Ineffective string escape `\}'
+13.elisp:17:23: In call to re-search-forward: Unescaped literal `$' (pos 0)
+  "$.x++"
+   ^
+13.elisp:17:23: Ineffective string escape `\$'
+13.elisp:17:25: Ineffective string escape `\.'
+13.elisp:17:28: Ineffective string escape `\+'
+13.elisp:17:30: In call to re-search-forward: Repetition of repetition (pos 4)
+  "$.x++"
+   ....^
+13.elisp:17:30: Ineffective string escape `\+'



reply via email to

[Prev in Thread] Current Thread [Next in Thread]