Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
d3b78c85
Commit
d3b78c85
authored
Jun 09, 2019
by
Lars Ingebrigtsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor suppressions
parent
30a8cfa2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
21 deletions
+22
-21
test/lisp/emacs-lisp/bytecomp-tests.el
test/lisp/emacs-lisp/bytecomp-tests.el
+22
-21
No files found.
test/lisp/emacs-lisp/bytecomp-tests.el
View file @
d3b78c85
...
...
@@ -680,29 +680,30 @@ literals (Bug#20852)."
(should-not (member '(byte-constant 333) lap))
(should (member '(byte-constant 444) lap)))))
(
ert-deftest bytecomp-test--with-suppressed-warnings (
)
(
defun test-suppression (form match
)
(let ((lexical-binding t)
(byte-compile-log-buffer (generate-new-buffer "
*Compile-Log*
")))
(let ((form '(defvar prefixless)))
(with-current-buffer byte-compile-log-buffer
(let ((inhibit-read-only t))
(erase-buffer)))
(test-byte-comp-compile-and-load t
form)
(with-current-buffer byte-compile-log-buffer
(goto-char (point-min))
(should (re-search-forward "
global/dynamic
var
.
prefixless.
lacks
"
nil t)))
(with-current-buffer byte-compile-log-buffer
(let ((inhibit-read-only t))
(erase-buffer)))
(test-byte-comp-compile-and-load t
`(with-suppressed-warnings ((lexical prefixless))
,form))
(with-current-buffer byte-compile-log-buffer
(goto-char (point-min))
(should-not (re-search-forward "
global/dynamic
var
.
prefixless.
lacks
"
nil
t
)
)))))
(with-current-buffer byte-compile-log-buffer
(let ((inhibit-read-only t))
(erase-buffer)))
(test-byte-comp-compile-and-load t
form)
(with-current-buffer byte-compile-log-buffer
(goto-char (point-min))
(should (re-search-forward match nil t)))
(with-current-buffer byte-compile-log-buffer
(let ((inhibit-read-only t))
(erase-buffer)))
(test-byte-comp-compile-and-load t
`(with-suppressed-warnings ((lexical prefixless))
,form))
(with-current-buffer byte-compile-log-buffer
(goto-char (point-min))
(should-not (re-search-forward match nil t)))))
(ert-deftest bytecomp-test--with-suppressed-warnings ()
(test-suppression '(defvar prefixless)
"
global/dynamic
var
.
prefixless.
lacks
"
)
)
;; Local Variables:
;; no-byte-compile: t
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment