diff options
| author | Stefan Kangas | 2022-07-28 14:38:24 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2022-07-28 15:07:34 +0200 |
| commit | b8fdef7aa65f5b1d2eeb726ff1627d9e169c2b3a (patch) | |
| tree | f743b882b3da21c38cafe40eb05634f72f844e96 /test | |
| parent | 38e7400a8c1feaba4362c3d7ab9d44d360a1fac6 (diff) | |
| download | emacs-b8fdef7aa65f5b1d2eeb726ff1627d9e169c2b3a.tar.gz emacs-b8fdef7aa65f5b1d2eeb726ff1627d9e169c2b3a.zip | |
Convert ffap comments to tests
* test/lisp/ffap-tests.el (ffap-file-remote-p, ffap-machine-p):
New tests.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/ffap-tests.el | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/lisp/ffap-tests.el b/test/lisp/ffap-tests.el index a11af9507ef..076d8256421 100644 --- a/test/lisp/ffap-tests.el +++ b/test/lisp/ffap-tests.el | |||
| @@ -33,6 +33,25 @@ | |||
| 33 | (ffap-replace-file-component "/ftp:who@foo.com:/whatever" "/new") | 33 | (ffap-replace-file-component "/ftp:who@foo.com:/whatever" "/new") |
| 34 | "/ftp:who@foo.com:/new"))) | 34 | "/ftp:who@foo.com:/new"))) |
| 35 | 35 | ||
| 36 | (ert-deftest ffap-file-remote-p () | ||
| 37 | (dolist (test '(("/user@foo.bar.com:/pub" . | ||
| 38 | "/user@foo.bar.com:/pub") | ||
| 39 | ("/cssun.mathcs.emory.edu://dir" . | ||
| 40 | "/cssun.mathcs.emory.edu:/dir") | ||
| 41 | ("/ffap.el:80" . | ||
| 42 | "/ffap.el:80"))) | ||
| 43 | (let ((A (car test)) | ||
| 44 | (B (cdr test))) | ||
| 45 | (should (equal (ffap-file-remote-p A) B))))) | ||
| 46 | |||
| 47 | (ert-deftest ffap-machine-p () | ||
| 48 | (should-not (ffap-machine-p "ftp")) | ||
| 49 | (should-not (ffap-machine-p "nonesuch")) | ||
| 50 | (should (eq (ffap-machine-p "ftp.mathcs.emory.edu") 'accept)) | ||
| 51 | (should-not (ffap-machine-p "mathcs" 5678)) | ||
| 52 | (should-not (ffap-machine-p "foo.bonk")) | ||
| 53 | (should (eq (ffap-machine-p "foo.bonk.com") 'accept))) | ||
| 54 | |||
| 36 | (ert-deftest ffap-tests-25243 () | 55 | (ert-deftest ffap-tests-25243 () |
| 37 | "Test for https://debbugs.gnu.org/25243 ." | 56 | "Test for https://debbugs.gnu.org/25243 ." |
| 38 | (ert-with-temp-file file | 57 | (ert-with-temp-file file |