emacs/test/lisp/emacs-lisp/rmc-tests.el
Andrea Corallo 825e85b393 Use advice-flet' in place of cl-letf' to avoid primitive redefinition
* test/lisp/time-stamp-tests.el (with-time-stamp-system-name): Use
	`advice-flet' to advice primitive avoiding redefinition.

	* test/lisp/tempo-tests.el (tempo-p-element-test)
	(tempo-P-element-test, tempo-r-element-test)
	(tempo-s-element-test, tempo-r>-element-test): Likewise.

	* test/lisp/subr-tests.el (subr-tests-bug22027): Likewise.

	* test/lisp/shadowfile-tests.el (shadow-test00-clusters)
	(shadow-test01-sites, shadow-test06-literal-groups)
	(shadow-test07-regexp-groups): Likewise.

	* test/lisp/replace-tests.el (replace-tests-with-undo): Likewise.

	* test/lisp/play/dissociate-tests.el
	(dissociate-tests-dissociated-press): Likewise.

	* test/lisp/net/tramp-tests.el (tramp-test10-write-region)
	(tramp-test21-file-links): Likewise.

	* test/lisp/kmacro-tests.el (kmacro-tests-call-macro-hint-and-repeat)
	(kmacro-tests-repeat-on-last-key)
	(kmacro-tests-repeat-view-and-run)
	(kmacro-tests-bind-to-key-with-key-sequence-in-use): Likewise.

	* test/lisp/files-tests.el (files-tests-read-file-in-~): Likewise.

	* test/lisp/emacs-lisp/rmc-tests.el (test-read-multiple-choice):
	Likewise.

	* test/lisp/bookmark-tests.el (bookmark-test-bmenu-locate):
	Likewise.

	* test/lisp/abbrev-tests.el
	(inverse-add-abbrev-skips-trailing-nonword)
	(inverse-add-abbrev-skips-trailing-nonword/positive-arg)
	(inverse-add-abbrev-skips-trailing-nonword/negative-arg): Likewise.
2020-10-02 21:20:53 +02:00

45 lines
1.3 KiB
EmacsLisp

;;; rmc-tests.el --- Test suite for rmc.el -*- lexical-binding: t -*-
;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
;; Author: Tino Calancha <tino.calancha@gmail.com>
;; Keywords:
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;
;;; Code:
(require 'ert)
(require 'rmc)
(eval-when-compile (require 'cl-lib))
(ert-deftest test-read-multiple-choice ()
(dolist (char '(?y ?n))
(let ((str (if (eq char ?y) "yes" "no")))
(advice-flet ((read-event
(lambda () char)))
(should (equal (list char str)
(read-multiple-choice "Do it? "
'((?y "yes") (?n "no")))))))))
(provide 'rmc-tests)
;;; rmc-tests.el ends here