我有一个emacs毛茛测试:
(describe
"Test"
(defun test-some (test-string actual expected)
(let ((act actual) (exp expected))
(it test-string
(expect act
:to-equal
exp))))
(test-some
"should be equal"
1
1))
然而,它给了我
Test should be equal
error: (void-variable act)
执行时。字符串在那里,所以至少test-string
是
正确传递。但是,另一方似乎存在问题
参数。
手册中的相关部分:https://github.com/jorgenschaefer/emacs-buttercup/#its-just-functions
答案 0 :(得分:0)
示例功能:
(cl-defun indent-and-compare (test-string file-name &key (uncompleted-indent 4))
(lexical-let ((act (concat file-name "-actual.nim")) (exp (concat file-name "-expected.nim"))
(indent uncompleted-indent))
(it test-string
(setq nim-uncompleted-condition-indent indent)
(insert-file-contents-literally act)
(indent-region (point-min) (point-max))
(expect (buffer-string)
:to-equal
(file-to-string exp)))))