diff options
Diffstat (limited to 'test/lisp/ffap-tests.el')
| -rw-r--r-- | test/lisp/ffap-tests.el | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/lisp/ffap-tests.el b/test/lisp/ffap-tests.el index 30c8f794577..e8c12669c1a 100644 --- a/test/lisp/ffap-tests.el +++ b/test/lisp/ffap-tests.el | |||
| @@ -77,6 +77,46 @@ left alone when opening a URL in an external browser." | |||
| 77 | (should (compare-window-configurations (current-window-configuration) old)) | 77 | (should (compare-window-configurations (current-window-configuration) old)) |
| 78 | (should (equal urls '("https://www.gnu.org"))))) | 78 | (should (equal urls '("https://www.gnu.org"))))) |
| 79 | 79 | ||
| 80 | (defun ffap-test-string (space string) | ||
| 81 | (let ((ffap-file-name-with-spaces space)) | ||
| 82 | (with-temp-buffer | ||
| 83 | (insert string) | ||
| 84 | (goto-char (point-min)) | ||
| 85 | (forward-char 10) | ||
| 86 | (ffap-string-at-point)))) | ||
| 87 | |||
| 88 | (ert-deftest ffap-test-with-spaces () | ||
| 89 | (should | ||
| 90 | (equal | ||
| 91 | (ffap-test-string | ||
| 92 | t "c:/Program Files/Open Text Evaluation Media/Open Text Exceed 14 x86/Program here.txt") | ||
| 93 | "/Program Files/Open Text Evaluation Media/Open Text Exceed 14 x86/Program here.txt")) | ||
| 94 | (should | ||
| 95 | (equal | ||
| 96 | (ffap-test-string | ||
| 97 | nil "c:/Program Files/Open Text Evaluation Media/Open Text Exceed 14 x86/Program here.txt") | ||
| 98 | "c:/Program")) | ||
| 99 | (should | ||
| 100 | (equal | ||
| 101 | (ffap-test-string | ||
| 102 | t "c:/Program Files/Open Text Evaluation Media/Open Text Exceed 14 x86/Program Files/Hummingbird/") | ||
| 103 | "/Program Files/Open Text Evaluation Media/Open Text Exceed 14 x86/Program Files/Hummingbird/")) | ||
| 104 | (should | ||
| 105 | (equal | ||
| 106 | (ffap-test-string | ||
| 107 | t "c:\\Program Files\\Open Text Evaluation Media\\Open Text Exceed 14 x86\\Program Files\\Hummingbird\\") | ||
| 108 | "\\Program Files\\Open Text Evaluation Media\\Open Text Exceed 14 x86\\Program Files\\Hummingbird\\")) | ||
| 109 | (should | ||
| 110 | (equal | ||
| 111 | (ffap-test-string | ||
| 112 | t "c:\\Program Files\\Freescale\\CW for MPC55xx and MPC56xx 2.10\\PowerPC_EABI_Tools\\Command_Line_Tools\\CLT_Usage_Notes.txt") | ||
| 113 | "\\Program Files\\Freescale\\CW for MPC55xx and MPC56xx 2.10\\PowerPC_EABI_Tools\\Command_Line_Tools\\CLT_Usage_Notes.txt")) | ||
| 114 | (should | ||
| 115 | (equal | ||
| 116 | (ffap-test-string | ||
| 117 | t "C:\\temp\\program.log on Windows or /var/log/program.log on Unix.") | ||
| 118 | "\\temp\\program.log"))) | ||
| 119 | |||
| 80 | (provide 'ffap-tests) | 120 | (provide 'ffap-tests) |
| 81 | 121 | ||
| 82 | ;;; ffap-tests.el ends here | 122 | ;;; ffap-tests.el ends here |