aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2011-10-15 12:24:14 -0700
committerGlenn Morris2011-10-15 12:24:14 -0700
commitc235b55508afa9a27d0c21768df7e13fffa7288e (patch)
tree1cdbbf4a00ad2cfe95d20933aeb28140f1333a20
parentec5c990d86ba7c5ba5b9084719e3c97fcdf3c408 (diff)
downloademacs-c235b55508afa9a27d0c21768df7e13fffa7288e.tar.gz
emacs-c235b55508afa9a27d0c21768df7e13fffa7288e.zip
* emacs-lisp/ert.el (ert--explain-equal-rec, ert-select-tests): Doc fixes.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/emacs-lisp/ert.el41
2 files changed, 25 insertions, 21 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 006c82a3166..abae693d0c8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12011-10-15 Glenn Morris <rgm@gnu.org>
2
3 * emacs-lisp/ert.el (ert--explain-equal-rec, ert-select-tests):
4 Doc fixes.
5
12011-10-15 Chong Yidong <cyd@stupidchicken.com> 62011-10-15 Chong Yidong <cyd@stupidchicken.com>
2 7
3 * net/network-stream.el (network-stream-open-starttls): Improve 8 * net/network-stream.el (network-stream-open-starttls): Improve
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index b2e20843856..2afe42dc070 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -577,8 +577,7 @@ failed."
577 (t x))) 577 (t x)))
578 578
579(defun ert--explain-equal-rec (a b) 579(defun ert--explain-equal-rec (a b)
580 "Returns a programmer-readable explanation of why A and B are not `equal'. 580 "Return a programmer-readable explanation of why A and B are not `equal'.
581
582Returns nil if they are." 581Returns nil if they are."
583 (if (not (equal (type-of a) (type-of b))) 582 (if (not (equal (type-of a) (type-of b)))
584 `(different-types ,a ,b) 583 `(different-types ,a ,b)
@@ -1020,36 +1019,36 @@ t -- Always matches.
1020 (ert-test-result-type-p result (ert-test-expected-result-type test))) 1019 (ert-test-result-type-p result (ert-test-expected-result-type test)))
1021 1020
1022(defun ert-select-tests (selector universe) 1021(defun ert-select-tests (selector universe)
1023 "Return the tests that match SELECTOR. 1022 "Return a list of tests that match SELECTOR.
1024
1025UNIVERSE specifies the set of tests to select from; it should be
1026a list of tests, or t, which refers to all tests named by symbols
1027in `obarray'.
1028 1023
1029Returns the set of tests as a list. 1024UNIVERSE specifies the set of tests to select from; it should be a list
1025of tests, or t, which refers to all tests named by symbols in `obarray'.
1030 1026
1031Valid selectors: 1027Valid SELECTORs:
1032 1028
1033nil -- Selects the empty set. 1029nil -- Selects the empty set.
1034t -- Selects UNIVERSE. 1030t -- Selects UNIVERSE.
1035:new -- Selects all tests that have not been run yet. 1031:new -- Selects all tests that have not been run yet.
1036:failed, :passed -- Select tests according to their most recent result. 1032:failed, :passed -- Select tests according to their most recent result.
1037:expected, :unexpected -- Select tests according to their most recent result. 1033:expected, :unexpected -- Select tests according to their most recent result.
1038a string -- Selects all tests that have a name that matches the string, 1034a string -- A regular expression selecting all tests with matching names.
1039 a regexp. 1035a test -- (i.e., an object of the ert-test data-type) Selects that test.
1040a test -- Selects that test.
1041a symbol -- Selects the test that the symbol names, errors if none. 1036a symbol -- Selects the test that the symbol names, errors if none.
1042\(member TESTS...\) -- Selects TESTS, a list of tests or symbols naming tests. 1037\(member TESTS...) -- Selects the elements of TESTS, a list of tests
1038 or symbols naming tests.
1043\(eql TEST\) -- Selects TEST, a test or a symbol naming a test. 1039\(eql TEST\) -- Selects TEST, a test or a symbol naming a test.
1044\(and SELECTORS...\) -- Selects the tests that match all SELECTORS. 1040\(and SELECTORS...) -- Selects the tests that match all SELECTORS.
1045\(or SELECTORS...\) -- Selects the tests that match any SELECTOR. 1041\(or SELECTORS...) -- Selects the tests that match any of the SELECTORS.
1046\(not SELECTOR\) -- Selects all tests that do not match SELECTOR. 1042\(not SELECTOR) -- Selects all tests that do not match SELECTOR.
1047\(tag TAG) -- Selects all tests that have TAG on their tags list. 1043\(tag TAG) -- Selects all tests that have TAG on their tags list.
1048\(satisfies PREDICATE\) -- Selects all tests that satisfy PREDICATE. 1044 A tag is an arbitrary label you can apply when you define a test.
1045\(satisfies PREDICATE) -- Selects all tests that satisfy PREDICATE.
1046 PREDICATE is a function that takes an ert-test object as argument,
1047 and returns non-nil if it is selected.
1049 1048
1050Only selectors that require a superset of tests, such 1049Only selectors that require a superset of tests, such
1051as (satisfies ...), strings, :new, etc. make use of UNIVERSE. 1050as (satisfies ...), strings, :new, etc. make use of UNIVERSE.
1052Selectors that do not, such as \(member ...\), just return the 1051Selectors that do not, such as (member ...), just return the
1053set implied by them without checking whether it is really 1052set implied by them without checking whether it is really
1054contained in UNIVERSE." 1053contained in UNIVERSE."
1055 ;; This code needs to match the etypecase in 1054 ;; This code needs to match the etypecase in