我正在尝试以交互方式运行 Emacs ert 测试,但它没有运行。我正在按照Emacs ERT 指南运行此示例测试:
(require 'ert)
(ert-deftest pp-test-quote ()
"Tests the rendering of `quote' symbols in `pp-to-string'."
(should (equal (pp-to-string '(quote quote)) "'quote"))
(should (equal (pp-to-string '((quote a) (quote b))) "('a 'b)\n"))
(should (equal (pp-to-string '('a 'b)) "('a 'b)\n")))
从缓冲区执行此测试M-x ert RET t RET将输出:
Selector: t
Passed: 0
Failed: 0
Skipped: 0
Total: 0/0
Started at: 2016-03-16 21:15:10+0100
Finished.
Finished at: 2016-03-16 21:15:10+0100
但如果从控制台执行(以批处理模式),它会起作用:
$ emacs -batch -l ert -l test.el -f ert-run-tests-batch-and-exit
Running 1 tests (2016-03-16 21:35:26+0100)
passed 1/1 pp-test-quote
Ran 1 tests, 1 results as expected (2016-03-16 21:35:26+0100)
我正在使用 emacs 24.5。