1 ;;; rmc-tests.el --- Test suite for rmc.el -*- lexical-binding: t -*-
3 ;; Copyright (C) 2017-2018 Free Software Foundation, Inc.
5 ;; Author: Tino Calancha <tino.calancha@gmail.com>
8 ;; This program is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation, either version 3 of the License, or
11 ;; (at your option) any later version.
13 ;; This program is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with this program. If not, see <https://www.gnu.org/licenses/>.
29 (eval-when-compile (require 'cl-lib
))
32 (ert-deftest test-read-multiple-choice
()
33 (dolist (char '(?y ?n
))
34 (cl-letf* (((symbol-function #'read-char
) (lambda () char
))
35 (str (if (eq char ?y
) "yes" "no")))
36 (should (equal (list char str
)
37 (read-multiple-choice "Do it? " '((?y
"yes") (?n
"no"))))))))
41 ;;; rmc-tests.el ends here