diff options
| author | Glenn Morris | 2011-10-15 12:24:14 -0700 |
|---|---|---|
| committer | Glenn Morris | 2011-10-15 12:24:14 -0700 |
| commit | c235b55508afa9a27d0c21768df7e13fffa7288e (patch) | |
| tree | 1cdbbf4a00ad2cfe95d20933aeb28140f1333a20 | |
| parent | ec5c990d86ba7c5ba5b9084719e3c97fcdf3c408 (diff) | |
| download | emacs-c235b55508afa9a27d0c21768df7e13fffa7288e.tar.gz emacs-c235b55508afa9a27d0c21768df7e13fffa7288e.zip | |
* emacs-lisp/ert.el (ert--explain-equal-rec, ert-select-tests): Doc fixes.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/ert.el | 41 |
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 @@ | |||
| 1 | 2011-10-15 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp/ert.el (ert--explain-equal-rec, ert-select-tests): | ||
| 4 | Doc fixes. | ||
| 5 | |||
| 1 | 2011-10-15 Chong Yidong <cyd@stupidchicken.com> | 6 | 2011-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 | |||
| 582 | Returns nil if they are." | 581 | Returns 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 | |||
| 1025 | UNIVERSE specifies the set of tests to select from; it should be | ||
| 1026 | a list of tests, or t, which refers to all tests named by symbols | ||
| 1027 | in `obarray'. | ||
| 1028 | 1023 | ||
| 1029 | Returns the set of tests as a list. | 1024 | UNIVERSE specifies the set of tests to select from; it should be a list |
| 1025 | of tests, or t, which refers to all tests named by symbols in `obarray'. | ||
| 1030 | 1026 | ||
| 1031 | Valid selectors: | 1027 | Valid SELECTORs: |
| 1032 | 1028 | ||
| 1033 | nil -- Selects the empty set. | 1029 | nil -- Selects the empty set. |
| 1034 | t -- Selects UNIVERSE. | 1030 | t -- 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. |
| 1038 | a string -- Selects all tests that have a name that matches the string, | 1034 | a string -- A regular expression selecting all tests with matching names. |
| 1039 | a regexp. | 1035 | a test -- (i.e., an object of the ert-test data-type) Selects that test. |
| 1040 | a test -- Selects that test. | ||
| 1041 | a symbol -- Selects the test that the symbol names, errors if none. | 1036 | a 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 | ||
| 1050 | Only selectors that require a superset of tests, such | 1049 | Only selectors that require a superset of tests, such |
| 1051 | as (satisfies ...), strings, :new, etc. make use of UNIVERSE. | 1050 | as (satisfies ...), strings, :new, etc. make use of UNIVERSE. |
| 1052 | Selectors that do not, such as \(member ...\), just return the | 1051 | Selectors that do not, such as (member ...), just return the |
| 1053 | set implied by them without checking whether it is really | 1052 | set implied by them without checking whether it is really |
| 1054 | contained in UNIVERSE." | 1053 | contained in UNIVERSE." |
| 1055 | ;; This code needs to match the etypecase in | 1054 | ;; This code needs to match the etypecase in |