Skip to content

Commit 80ce0a8

Browse files
committed
Add: expectations
1 parent 039a13f commit 80ce0a8

File tree

2 files changed

+55
-2
lines changed

2 files changed

+55
-2
lines changed

README.org

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2647,6 +2647,29 @@ It provides:
26472647
Assess aims to be a stateless as possible, leaving Emacs unchanged whether the tests succeed or fail, with respect to buffers, open files and so on; this helps to keep tests independent from each other.
26482648
#+END_QUOTE
26492649

2650+
***** [[https://www.emacswiki.org/emacs/ert-expectations.el][ert-expectations]] :ERT:
2651+
2652+
=expectations= allows more concise definitions of ERT tests. For example:
2653+
2654+
#+BEGIN_SRC elisp
2655+
;; With ERT:
2656+
2657+
(ert-deftest erte-test-00001 ()
2658+
(should (equal 10 (+ 4 6))))
2659+
2660+
;; With Expectations:
2661+
(expect 10 (+ 4 6))
2662+
2663+
;; Or:
2664+
(expectations
2665+
(desc "success")
2666+
(expect 10 (+ 4 6))
2667+
(expect 5 (length "abcde"))
2668+
(desc "fail")
2669+
(expect 11 (+ 4 6))
2670+
(expect 6 (length "abcde")))
2671+
#+END_SRC
2672+
26502673
***** [[https://github.com/DarwinAwardWinner/with-simulated-input][with-simulated-input: Test interactive functions non-interactively]]
26512674

26522675
#+BEGIN_QUOTE

index.html

Lines changed: 32 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)