aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/ffap-tests.el
diff options
context:
space:
mode:
authorVibhav Pant2020-08-21 14:04:35 +0530
committerVibhav Pant2020-08-21 14:04:35 +0530
commitf0f8d7b82492e741950c363a03b886965c91b1b0 (patch)
tree19b716830b1ebabc0d7d75949c4e6800c0f104ad /test/lisp/ffap-tests.el
parent9e64a087c4d167e7ec1c4e22bea3e6af53b563de (diff)
parentc818c29771d3cb51875643b2f6c894073e429dd2 (diff)
downloademacs-feature/native-comp-macos-fixes.tar.gz
emacs-feature/native-comp-macos-fixes.zip
Merge branch 'feature/native-comp' into feature/native-comp-macos-fixesfeature/native-comp-macos-fixes
Diffstat (limited to 'test/lisp/ffap-tests.el')
-rw-r--r--test/lisp/ffap-tests.el40
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