diff options
| author | Ted Zlatanov | 2012-02-13 13:45:36 -0500 |
|---|---|---|
| committer | Ted Zlatanov | 2012-02-13 13:45:36 -0500 |
| commit | 6c0c7cfc6755342c15e0230747d7f0c697c899d9 (patch) | |
| tree | 7e508c62ef01da5ec4889dedf260a1e861c0c616 /lisp | |
| parent | c14fcc95713913de0fa9d84e3ed502bcb0b07c38 (diff) | |
| download | emacs-6c0c7cfc6755342c15e0230747d7f0c697c899d9.tar.gz emacs-6c0c7cfc6755342c15e0230747d7f0c697c899d9.zip | |
Move url-future.el ERT test to test/automated/url-future-tests.el.
* lisp/url/url-future.el (url-future-test): Move to test/automated.
* test/automated/url-future-tests.el (url-future-tests): Move from
lisp/url/url-future.el and rename.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/url/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/url/url-future.el | 27 |
2 files changed, 4 insertions, 27 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 4f49adcd932..0340c954aea 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-02-13 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 2 | |||
| 3 | * url-future.el (url-future-test): Move to test/automated. | ||
| 4 | |||
| 1 | 2012-02-10 Lars Ingebrigtsen <larsi@gnus.org> | 5 | 2012-02-10 Lars Ingebrigtsen <larsi@gnus.org> |
| 2 | 6 | ||
| 3 | * url-http.el (url-http-parse-headers): When redirecting, pass on | 7 | * url-http.el (url-http-parse-headers): When redirecting, pass on |
diff --git a/lisp/url/url-future.el b/lisp/url/url-future.el index 2798f936f21..f35399469c8 100644 --- a/lisp/url/url-future.el +++ b/lisp/url/url-future.el | |||
| @@ -95,32 +95,5 @@ | |||
| 95 | (signal 'error 'url-future-already-done) | 95 | (signal 'error 'url-future-already-done) |
| 96 | (url-future-finish url-future 'cancel))) | 96 | (url-future-finish url-future 'cancel))) |
| 97 | 97 | ||
| 98 | (ert-deftest url-future-test () | ||
| 99 | (let* (saver | ||
| 100 | (text "running future") | ||
| 101 | (good (make-url-future :value (lambda () (format text)) | ||
| 102 | :callback (lambda (f) (set 'saver f)))) | ||
| 103 | (bad (make-url-future :value (lambda () (/ 1 0)) | ||
| 104 | :errorback (lambda (&rest d) (set 'saver d)))) | ||
| 105 | (tocancel (make-url-future :value (lambda () (/ 1 0)) | ||
| 106 | :callback (lambda (f) (set 'saver f)) | ||
| 107 | :errorback (lambda (&rest d) | ||
| 108 | (set 'saver d))))) | ||
| 109 | (should (equal good (url-future-call good))) | ||
| 110 | (should (equal good saver)) | ||
| 111 | (should (equal text (url-future-value good))) | ||
| 112 | (should (url-future-completed-p good)) | ||
| 113 | (should-error (url-future-call good)) | ||
| 114 | (setq saver nil) | ||
| 115 | (should (equal bad (url-future-call bad))) | ||
| 116 | (should-error (url-future-call bad)) | ||
| 117 | (should (equal saver (list bad '(arith-error)))) | ||
| 118 | (should (url-future-errored-p bad)) | ||
| 119 | (setq saver nil) | ||
| 120 | (should (equal (url-future-cancel tocancel) tocancel)) | ||
| 121 | (should-error (url-future-call tocancel)) | ||
| 122 | (should (null saver)) | ||
| 123 | (should (url-future-cancelled-p tocancel)))) | ||
| 124 | |||
| 125 | (provide 'url-future) | 98 | (provide 'url-future) |
| 126 | ;;; url-future.el ends here | 99 | ;;; url-future.el ends here |