[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 6871e649b5 1/2: Add new drag-and-drop test
From: |
Po Lu |
Subject: |
master 6871e649b5 1/2: Add new drag-and-drop test |
Date: |
Tue, 7 Jun 2022 01:49:57 -0400 (EDT) |
branch: master
commit 6871e649b52e3a6154cfe2495372c4652688588f
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Add new drag-and-drop test
* test/lisp/dnd-tests.el (dnd-tests-get-local-file-uri): New
test.
---
test/lisp/dnd-tests.el | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/test/lisp/dnd-tests.el b/test/lisp/dnd-tests.el
index fbd6ce6a2c..f194f3eac4 100644
--- a/test/lisp/dnd-tests.el
+++ b/test/lisp/dnd-tests.el
@@ -21,8 +21,8 @@
;; Tests for stuff in dnd.el that doesn't require a window system.
-;; At present, these tests only checks the behavior of the simplified
-;; drag APIs in dnd.el. Actual drags are not performed.
+;; The drag API tests only check the behavior of the simplified drag
+;; APIs in dnd.el. Actual drags are not performed.
;;; Code:
@@ -194,5 +194,14 @@ The temporary file is not created."
(delete-file normal-temp-file-1)
(delete-file remote-temp-file))))
+(ert-deftest dnd-tests-get-local-file-uri ()
+ (should (equal (dnd-get-local-file-uri "file://localhost/path/to/foo")
+ "file:///path/to/foo"))
+ (should (equal (dnd-get-local-file-uri
+ (format "file://%s/path/to/" (system-name)))
+ "file:///path/to/"))
+ (should-not (dnd-get-local-file-uri "file://some-remote-host/path/to/foo"))
+ (should-not (dnd-get-local-file-uri "file:///path/to/foo")))
+
(provide 'dnd-tests)
;;; dnd-tests.el ends here