diff options
| author | Mattias EngdegÄrd | 2019-07-31 19:45:06 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2019-08-06 13:38:47 +0200 |
| commit | c676444a43e4634c1f98ec286b5bd9e46b23216b (patch) | |
| tree | 8381c0ef5720a92b845808e8e885f6b5976ee0a1 /test | |
| parent | 1d8b5bc8dd543ada2f3c46436e43ea27faa3cd0e (diff) | |
| download | emacs-c676444a43e4634c1f98ec286b5bd9e46b23216b.tar.gz emacs-c676444a43e4634c1f98ec286b5bd9e46b23216b.zip | |
Add conditional operator xor to subr.el
Suggested by Oleh Krehel and implemented by Basil Contovounesios in
the following thread:
https://lists.gnu.org/archive/html/emacs-devel/2019-07/msg00547.html
* lisp/array.el (xor): Move unused function from here...
* lisp/subr.el: ...to here, and improve.
* lisp/gnus/spam.el (spam-xor):
* lisp/play/5x5.el (5x5-xor):
* lisp/proced.el (proced-xor):
* lisp/progmodes/idlwave.el (idlwave-xor):
* lisp/vc/diff-mode.el (diff-xor): Define as obsolete aliases of,
and replace all uses with, xor.
* lisp/jsonrpc.el: Remove unused dependency on array.el.
* lisp/org/org.el (org-xor): Move from here...
* lisp/org/org-compat.el (org-xor): ...to here, as a compatibility
shim for xor.
* lisp/progmodes/idlw-shell.el (idlwave-shell-enable-all-bp):
* lisp/simple.el (exchange-point-and-mark):
* lisp/windmove.el (windmove-display-in-direction): Use xor.
* lisp/strokes.el (strokes-xor): Remove commented-out xor
implementation.
* doc/lispref/control.texi (Control Structures): Extend menu entry
for new combining condition.
(Combining Conditions):
* etc/NEWS (Lisp Changes): Document xor.
* test/lisp/subr-tests.el (subr-test-xor): New test.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/subr-tests.el | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 0023680738d..b3c04cdc9a8 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el | |||
| @@ -125,6 +125,13 @@ | |||
| 125 | (should (equal (macroexpand-all '(when a b c d)) | 125 | (should (equal (macroexpand-all '(when a b c d)) |
| 126 | '(if a (progn b c d))))) | 126 | '(if a (progn b c d))))) |
| 127 | 127 | ||
| 128 | (ert-deftest subr-test-xor () | ||
| 129 | "Test `xor'." | ||
| 130 | (should-not (xor nil nil)) | ||
| 131 | (should (eq (xor nil 'true) 'true)) | ||
| 132 | (should (eq (xor 'true nil) 'true)) | ||
| 133 | (should-not (xor t t))) | ||
| 134 | |||
| 128 | (ert-deftest subr-test-version-parsing () | 135 | (ert-deftest subr-test-version-parsing () |
| 129 | (should (equal (version-to-list ".5") '(0 5))) | 136 | (should (equal (version-to-list ".5") '(0 5))) |
| 130 | (should (equal (version-to-list "0.9 alpha1") '(0 9 -3 1))) | 137 | (should (equal (version-to-list "0.9 alpha1") '(0 9 -3 1))) |