emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/hyperdrive 5709167d98 24/82: Test: different-drive-same-pa


From: ELPA Syncer
Subject: [nongnu] elpa/hyperdrive 5709167d98 24/82: Test: different-drive-same-path-*
Date: Mon, 25 Sep 2023 19:00:51 -0400 (EDT)

branch: elpa/hyperdrive
commit 5709167d98423fa4bd9092f8ac1f32253532c3f6
Author: Joseph Turner <joseph@ushin.org>
Commit: Joseph Turner <joseph@ushin.org>

    Test: different-drive-same-path-*
    
    For all combinations, a full "hyper://" should be inserted.
---
 tests/test-hyperdrive-org-link.el | 110 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 110 insertions(+)

diff --git a/tests/test-hyperdrive-org-link.el 
b/tests/test-hyperdrive-org-link.el
index 88db0511e7..2c60cdf363 100644
--- a/tests/test-hyperdrive-org-link.el
+++ b/tests/test-hyperdrive-org-link.el
@@ -227,6 +227,116 @@
                     (hyperdrive-org-link-full-url t))
               :result 
"[[hyper://deadbeef/foo/bar%20quux.org#%3A%3A%2AHeading%20A]]")))
 
+(hyperdrive-test-org-link-deftest different-drive-same-path-before-heading
+  :store-body "<|>
+* Heading A
+:PROPERTIES:
+:CUSTOM_ID: example ID
+:END:
+* Heading B"
+  :store-from '("deadbeef" . "/foo/bar quux.org")
+  :insert-into '("fredbeef" . "/foo/bar quux.org")
+  :results (( :let ((org-link-file-path-type 'relative)
+                    (hyperdrive-org-link-full-url nil))
+              :result "[[hyper://deadbeef/foo/bar%20quux.org]]")
+            ( :let ((org-link-file-path-type 'relative)
+                    (hyperdrive-org-link-full-url t))
+              :result "[[hyper://deadbeef/foo/bar%20quux.org]]")
+
+            ( :let ((org-link-file-path-type 'absolute)
+                    (hyperdrive-org-link-full-url nil))
+              :result "[[hyper://deadbeef/foo/bar%20quux.org]]")
+            ( :let ((org-link-file-path-type 'absolute)
+                    (hyperdrive-org-link-full-url t))
+              :result "[[hyper://deadbeef/foo/bar%20quux.org]]")
+
+            ( :let ((org-link-file-path-type 'noabbrev)
+                    (hyperdrive-org-link-full-url nil))
+              :result "[[hyper://deadbeef/foo/bar%20quux.org]]")
+            ( :let ((org-link-file-path-type 'noabbrev)
+                    (hyperdrive-org-link-full-url t))
+              :result "[[hyper://deadbeef/foo/bar%20quux.org]]")
+
+            ( :let ((org-link-file-path-type 'adaptive)
+                    (hyperdrive-org-link-full-url nil))
+              :result "[[hyper://deadbeef/foo/bar%20quux.org]]")
+            ( :let ((org-link-file-path-type 'adaptive)
+                    (hyperdrive-org-link-full-url t))
+              :result "[[hyper://deadbeef/foo/bar%20quux.org]]")))
+
+(hyperdrive-test-org-link-deftest 
different-drive-same-path-on-heading-with-custom-id
+  :store-body "
+* Heading A
+:PROPERTIES:
+:CUSTOM_ID: baz zot
+:END:
+<|>
+* Heading B"
+  :store-from '("deadbeef" . "/foo/bar quux.org")
+  :insert-into '("fredbeef" . "/foo/bar quux.org")
+  :results (( :let ((org-link-file-path-type 'relative)
+                    (hyperdrive-org-link-full-url nil))
+              :result 
"[[hyper://deadbeef/foo/bar%20quux.org#%3A%3A%23baz%20zot]]")
+            ( :let ((org-link-file-path-type 'relative)
+                    (hyperdrive-org-link-full-url t))
+              :result 
"[[hyper://deadbeef/foo/bar%20quux.org#%3A%3A%23baz%20zot]]")
+
+            ( :let ((org-link-file-path-type 'absolute)
+                    (hyperdrive-org-link-full-url nil))
+              :result 
"[[hyper://deadbeef/foo/bar%20quux.org#%3A%3A%23baz%20zot]]")
+            ( :let ((org-link-file-path-type 'absolute)
+                    (hyperdrive-org-link-full-url t))
+              :result 
"[[hyper://deadbeef/foo/bar%20quux.org#%3A%3A%23baz%20zot]]")
+
+            ( :let ((org-link-file-path-type 'noabbrev)
+                    (hyperdrive-org-link-full-url nil))
+              :result 
"[[hyper://deadbeef/foo/bar%20quux.org#%3A%3A%23baz%20zot]]")
+            ( :let ((org-link-file-path-type 'noabbrev)
+                    (hyperdrive-org-link-full-url t))
+              :result 
"[[hyper://deadbeef/foo/bar%20quux.org#%3A%3A%23baz%20zot]]")
+
+            ( :let ((org-link-file-path-type 'adaptive)
+                    (hyperdrive-org-link-full-url nil))
+              :result 
"[[hyper://deadbeef/foo/bar%20quux.org#%3A%3A%23baz%20zot]]")
+            ( :let ((org-link-file-path-type 'adaptive)
+                    (hyperdrive-org-link-full-url t))
+              :result 
"[[hyper://deadbeef/foo/bar%20quux.org#%3A%3A%23baz%20zot]]")))
+
+(hyperdrive-test-org-link-deftest 
different-drive-same-path-on-heading-no-custom-id
+  :store-body "
+* Heading A
+<|>
+* Heading B"
+  :store-from '("deadbeef" . "/foo/bar quux.org")
+  :insert-into '("fredbeef" . "/foo/bar quux.org")
+  :results (( :let ((org-link-file-path-type 'relative)
+                    (hyperdrive-org-link-full-url nil))
+              :result 
"[[hyper://deadbeef/foo/bar%20quux.org#%3A%3A%2AHeading%20A]]")
+            ( :let ((org-link-file-path-type 'relative)
+                    (hyperdrive-org-link-full-url t))
+              :result 
"[[hyper://deadbeef/foo/bar%20quux.org#%3A%3A%2AHeading%20A]]")
+
+            ( :let ((org-link-file-path-type 'absolute)
+                    (hyperdrive-org-link-full-url nil))
+              :result 
"[[hyper://deadbeef/foo/bar%20quux.org#%3A%3A%2AHeading%20A]]")
+            ( :let ((org-link-file-path-type 'absolute)
+                    (hyperdrive-org-link-full-url t))
+              :result 
"[[hyper://deadbeef/foo/bar%20quux.org#%3A%3A%2AHeading%20A]]")
+
+            ( :let ((org-link-file-path-type 'noabbrev)
+                    (hyperdrive-org-link-full-url nil))
+              :result 
"[[hyper://deadbeef/foo/bar%20quux.org#%3A%3A%2AHeading%20A]]")
+            ( :let ((org-link-file-path-type 'noabbrev)
+                    (hyperdrive-org-link-full-url t))
+              :result 
"[[hyper://deadbeef/foo/bar%20quux.org#%3A%3A%2AHeading%20A]]")
+
+            ( :let ((org-link-file-path-type 'adaptive)
+                    (hyperdrive-org-link-full-url nil))
+              :result 
"[[hyper://deadbeef/foo/bar%20quux.org#%3A%3A%2AHeading%20A]]")
+            ( :let ((org-link-file-path-type 'adaptive)
+                    (hyperdrive-org-link-full-url t))
+              :result 
"[[hyper://deadbeef/foo/bar%20quux.org#%3A%3A%2AHeading%20A]]")))
+
 ;;     * ~CUSTOM_ID~ :: e.g.
 ;;       ~hyper://deadbeef/foo/bar%20quux.org#%3A%3A%23baz%20zot~, which 
decodes to ~hyper://deadbeef/foo/bar quux.org#::#baz zot~
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]