Avoid eager macro-expansion error in tests files on Emacs 27 and 28 by
ensuring definitions provided by Compat, like `macroexp-file-name',
load first.
* lisp/erc/erc-speedbar.el (erc-speedbar--reset-last-ran-on-timer):
Suppress "`buffer-local-value' is an obsolete generalized variable"
warning on Emacs 29 and below.
* lisp/erc/erc-stamp.el (erc-stamp--time-as-day): Avoid "unused
lexical variable `current-time-list'" warning on 28 and below.
* lisp/erc/erc.el (erc-check-text-conversion): Add `defvar' for
`text-conversion-style' to avoid "reference to free variable" warning
on Emacs 29 and below.
* test/lisp/erc/erc-button-tests.el: Load `erc-button' before `ert-x'.
* test/lisp/erc/erc-fill-tests.el: Load `erc-fill' before `ert-x'.
* test/lisp/erc/erc-goodies-tests.el: Load `erc-goodies' before
`ert-x'.
* test/lisp/erc/erc-networks-tests.el: Explicitly load `erc-compat'
before anything else.
* test/lisp/erc/erc-scenarios-base-renick.el: Update timeouts.
* test/lisp/erc/erc-stamp-tests.el: Load `erc-stamp' before `ert-x'.
* test/lisp/erc/erc-tests.el: Load `erc-ring' before `ert-x'.
(cherry picked from commit
a43b062ee57fd9b7c410e741946e51281db5b92a)
(defun erc-speedbar--reset-last-ran-on-timer ()
"Reset `erc-speedbar--last-ran'."
(when speedbar-buffer
- (setf (buffer-local-value 'erc-speedbar--last-ran speedbar-buffer)
- (current-time))))
+ (with-suppressed-warnings ((obsolete buffer-local-value)) ; <=29
+ (setf (buffer-local-value 'erc-speedbar--last-ran speedbar-buffer)
+ (current-time)))))
;;;###autoload(autoload 'erc-nickbar-mode "erc-speedbar" nil t)
(define-erc-module nickbar nil
;; perform day alignments via this function only when needed.
(defun erc-stamp--time-as-day (current-time)
"Discard hour, minute, and second info from timestamp CURRENT-TIME."
+ (defvar current-time-list) ; <=28
(let* ((current-time-list) ; flag
(decoded (decode-time current-time erc-stamp--tz)))
(setf (decoded-time-second decoded) 0
purpose of typing within the ERC prompt."
(when (and (eq major-mode 'erc-mode)
(fboundp 'set-text-conversion-style))
+ (defvar text-conversion-style) ; avoid free variable warning on <=29
(if (>= (point) (erc-beg-of-input-line))
(unless (eq text-conversion-style 'action)
(set-text-conversion-style 'action))
;;; Commentary:
;;; Code:
+(require 'erc-button)
(require 'ert-x) ; cl-lib
(eval-and-compile
(let ((load-path (cons (ert-resource-directory) load-path)))
(require 'erc-tests-common)))
-(require 'erc-button)
-
(ert-deftest erc-button-alist--url ()
(erc-tests-common-init-server-proc "sleep" "1")
(with-current-buffer (erc--open-target "#chan")
;; scenarios.
;;; Code:
+(require 'erc-fill)
+
(require 'ert-x)
(eval-and-compile
(let ((load-path (cons (ert-resource-directory) load-path)))
(require 'erc-tests-common)))
-(require 'erc-fill)
-
(defvar erc-fill-tests--buffers nil)
(defvar erc-fill-tests--current-time-value nil)
;;; Commentary:
;;; Code:
+(require 'erc-goodies)
+
(require 'ert-x)
(eval-and-compile
(let ((load-path (cons (ert-resource-directory) load-path)))
(require 'erc-tests-common)))
-(require 'erc-goodies)
-
(defun erc-goodies-tests--assert-face (beg end-str present &optional absent)
(setq beg (+ beg (point-min)))
(let ((end (+ beg (1- (length end-str)))))
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Code:
+(require 'erc-compat)
(require 'ert-x) ; cl-lib
(eval-and-compile
(should-not (get-buffer "rando@barnet"))
(with-current-buffer "frenemy@foonet"
- (funcall expect 1 "now known as")
- (funcall expect 1 "doubly so"))
+ (funcall expect 10 "now known as")
+ (funcall expect 10 "doubly so"))
(with-current-buffer "frenemy@barnet"
- (funcall expect 1 "now known as")
- (funcall expect 1 "reality picture"))
+ (funcall expect 10 "now known as")
+ (funcall expect 10 "reality picture"))
(when noninteractive
(with-current-buffer "frenemy@barnet" (kill-buffer))
;;; Commentary:
;;; Code:
+(require 'erc-stamp)
+(require 'erc-goodies) ; for `erc-make-read-only'
+
(require 'ert-x)
(eval-and-compile
(let ((load-path (cons (ert-resource-directory) load-path)))
(require 'erc-tests-common)))
-(require 'erc-stamp)
-(require 'erc-goodies) ; for `erc-make-read-only'
-
;; These display-oriented tests are brittle because many factors
;; influence how text properties are applied. We should just
;; rework these into full scenarios.
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Code:
+(require 'erc-ring)
(require 'ert-x)
(eval-and-compile
(let ((load-path (cons (ert-resource-directory) load-path)))
(require 'erc-tests-common)))
-(require 'erc-ring)
(ert-deftest erc--read-time-period ()
(cl-letf (((symbol-function 'read-string) (lambda (&rest _) "")))