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

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

[nongnu] elpa/hyperdrive 759142d99e 77/82: Tests: Remove old Org link te


From: ELPA Syncer
Subject: [nongnu] elpa/hyperdrive 759142d99e 77/82: Tests: Remove old Org link tests from main test file
Date: Mon, 25 Sep 2023 19:00:56 -0400 (EDT)

branch: elpa/hyperdrive
commit 759142d99eefec8003165e66ba82fe139baa7c5c
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>

    Tests: Remove old Org link tests from main test file
---
 tests/test-hyperdrive.el | 195 -----------------------------------------------
 1 file changed, 195 deletions(-)

diff --git a/tests/test-hyperdrive.el b/tests/test-hyperdrive.el
index d10ff57386..1c6882fc7b 100644
--- a/tests/test-hyperdrive.el
+++ b/tests/test-hyperdrive.el
@@ -36,8 +36,6 @@
 (require 'pcase)
 (require 'url)
 
-(require 'with-simulated-input)
-
 (require 'hyperdrive)
 
 ;;;; Magic constants
@@ -134,196 +132,3 @@
                                     (make-url 
"/name%20without%20spaces/subdir")))))
     (should (equal url (concat "hyper://" test-hyperdrive-public-key
                                "/name%20without%20spaces/subdir")))))
-
-;;;; Link testing
-
-;;;;; Opening links
-
-(require 'hyperdrive-org)
-
-;;;;;; URL links (i.e. "hyper://"-prefixed)
-
-(defun hyperdrive-test-org-url-link (url)
-  "Return the URL that would be opened by `hyperdrive-open' for URL."
-  (let (called-with-url)
-    (with-temp-buffer
-      (org-mode)
-      (insert url)
-      (goto-char 1)
-      (cl-letf (((symbol-function 'hyperdrive-open)
-                 (lambda (entry &rest _)
-                   (setf called-with-url (hyperdrive-entry-url entry)))))
-        (org-open-at-point)))
-    called-with-url))
-
-(ert-deftest hyperdrive-org-link-with-protocol-no-target ()
-  (let ((links '(("hyper://public_key/links%20test.org" . 
"hyper://public_key/links%20test.org")
-                 ("[[hyper://public_key/links%20test.org]]" . 
"hyper://public_key/links%20test.org"))))
-    (dolist (link links)
-      (should (equal (hyperdrive-test-org-url-link (car link)) (cdr link))))))
-
-(ert-deftest hyperdrive-org-link-with-protocol-with-target ()
-  (let ((links '(("[[hyper://public_key/links%20test.org#Heading%20A]]"
-                  . "hyper://public_key/links%20test.org#Heading%20A")
-                 ("hyper://public_key/links%20test.org#Heading%20A"
-                  . "hyper://public_key/links%20test.org#Heading%20A"))))
-    (dolist (link links)
-      (should (equal (hyperdrive-test-org-url-link (car link)) (cdr link))))))
-
-;;;;;; Org links (i.e. not "hyper://"-prefixed)
-
-(defun hyperdrive-test-org-link (link)
-  ;; FIXME: Docstring.
-  "Return the URL that would be opened by `hyperdrive-open' for LINK.
-LINK is an Org link as a string."
-  (let (called-with-url)
-    (with-temp-buffer
-      (org-mode)
-      (hyperdrive-mode)
-      (insert link)
-      (goto-char 1)
-      (cl-letf (((symbol-function 'hyperdrive-open)
-                 (lambda (entry &rest _)
-                   (setf called-with-url (hyperdrive-entry-url entry)))))
-        (org-open-at-point)))
-    called-with-url))
-
-;; (ert-deftest 
hyperdrive-org-link-without-protocol-without-target-filename-with-spaces ()
-;;   (let ((links '(("[[links test.org]]"))))
-;;     (dolist (link links)
-;;       (should (equal )))))
-
-;; (ert-deftest 
hyperdrive-org-link-without-protocol-without-file-with-asterisk-target ()
-;;   (let ((links '(("[[*Heading A]]"))))
-;;     (dolist (link links)
-;;       (should (equal (hyperdrive-test-org-link (car link)) "WHAT")))))
-
-;;;;; Inserting links
-
-;; (cl-defun hyperdrive-test-org-link-roundtrip
-;;     (contents &key store-from insert-into)
-;;   (let ((org-id-link-to-org-use-id nil)
-;;         (default-directory "/")
-;;         (org-link-file-path-type
-;;          (lambda (path)
-;;            (replace-regexp-in-string (rx bos (optional "file:")
-;;                                          "/hyper:/")
-;;                                      "hyper://" path)))
-;;         ;; (org-link-file-path-type
-;;         ;;  (lambda (path)
-;;         ;;    (string-trim-left (file-relative-name path)
-;;         ;;                      (rx "file:"))))
-;;         (store-from-entry (hyperdrive-entry-create
-;;                            :hyperdrive (hyperdrive-create :public-key (car 
store-from))
-;;                            :path (cdr store-from)))
-;;         (insert-into-entry (hyperdrive-entry-create
-;;                             :hyperdrive (hyperdrive-create :public-key (car 
insert-into))
-;;                             :path (cdr insert-into)))
-;;         org-stored-links)
-;;     (with-temp-buffer
-;;       (insert contents)
-;;       (org-mode)
-;;       (hyperdrive-mode)
-;;       (setq-local hyperdrive-current-entry store-from-entry)
-;;       (goto-char (point-min))
-;;       (re-search-forward (rx "<|>"))
-;;       (org-store-link nil 'interactive))
-;;     (with-temp-buffer
-;;       (org-mode)
-;;       (hyperdrive-mode)
-;;       (setq-local hyperdrive-current-entry insert-into-entry)
-;;       (with-simulated-input "RET"
-;;         (org-insert-link))
-;;       (buffer-substring-no-properties (point-min) (point-max)))))
-
-;; ;;;;;; Test cases
-
-;; (ert-deftest 
hyperdrive-link-no-protocol-no-path-same-drive-same-file-custom-id ()
-;;   (should
-;;    (equal "[[#example ID]]"
-;;           (hyperdrive-test-org-link-roundtrip
-;;            "
-;; * Heading A
-;; :PROPERTIES:
-;; :CUSTOM_ID: example ID
-;; :END:
-;; <|>
-;; * Heading B"
-;;            :store-from '("deadbeef" . "/foo/bar.org")
-;;            :insert-into '("deadbeef" . "/foo/bar.org")))))
-
-;; (ert-deftest hyperdrive-link-same-drive-different-file-before-heading ()
-;;   "Linking to a file (before the first heading) and on same drive."
-;;   (should
-;;    (equal "[[/foo/bar.org]]"
-;;           (hyperdrive-test-org-link-roundtrip
-;;            "<|>
-;; * Heading A
-;; * Heading B"
-;;            :store-from '("deadbeef" . "/foo/bar.org")
-;;            :insert-into '("deadbeef" . "/foo/zot.org")))))
-
-;; (ert-deftest 
hyperdrive-link-same-drive-same-file-in-heading-without-custom-id ()
-;;   "Linking to a heading within the same file (and on same drive)."
-;;   (should
-;;    (equal "[[*Heading A]]"
-;;           (hyperdrive-test-org-link-roundtrip
-;;            "* Heading A
-;; <|>
-;; * Heading B"
-;;            :store-from '("deadbeef" . "/foo/bar.org")
-;;            :insert-into '("deadbeef" . "/foo/bar.org")))))
-
-;; (ert-deftest hyperdrive-link-heading-within-drive ()
-;;   "Linking to a heading within the same drive but different file.")
-
-;; ;;;;;;; With protocol
-
-;; ;; These links will look the same regardless of hyperdrive or path.
-
-;; (ert-deftest hyperdrive-link-different-drive-with-custom-id ()
-;;   (should
-;;    (equal "[[hyper://deadbeef/foo/bar.org#%3A%3A%23example%20ID]]"
-;;           (hyperdrive-test-org-link-roundtrip
-;;            "
-;; * Heading A
-;; :PROPERTIES:
-;; :CUSTOM_ID: example ID
-;; :END:
-;; <|>
-;; * Heading B"
-;;            :store-from '("deadbeef" . "/foo/bar.org")
-;;            :insert-into '("fredbeef" . "/foo/bar.org")))))
-
-;; ;; (hyperdrive-test-org-link-roundtrip
-;; ;;  "<|>
-;; ;; * Heading A
-;; ;; * Heading B")
-;; ;; "[[hyper://public-key/foo/bar]]"
-
-;; ;; (hyperdrive-test-org-link-roundtrip
-;; ;;  "* Heading A
-;; ;; <|>
-;; ;; * Heading B")
-;; ;; "[[hyper://public-key/foo/bar#Heading%20A][Heading A]]"
-
-;; ;; (hyperdrive-test-org-link-roundtrip
-;; ;;  "* Heading A
-;; ;; :PROPERTIES:
-;; ;; :ID: deadbeef
-;; ;; :END:
-;; ;; <|>
-;; ;; * Heading B")
-;; ;; "[[hyper://public-key/foo/bar#deadbeef][Heading A]]"
-
-;; ;; (hyperdrive-test-org-link-roundtrip
-;; ;;  "* Heading A
-;; ;; :PROPERTIES:
-;; ;; :CUSTOM_ID: custom-id
-;; ;; :END:
-;; ;; <|>
-;; ;; * Heading B")
-;; ;; "[[hyper://public-key/foo/bar#custom-id][Heading A]]"
-
-
-;; ;; "hyper://public-key/foo/bar#deadbeef"



reply via email to

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