From c57f0975f68a0835d39e6d48cfee5945ce89774c Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 16 Jun 2021 17:07:11 -0500 Subject: [PATCH] Tests: Add more LINK tests Closes https://github.com/alphapapa/org-ql/pull/222. See also https://github.com/alphapapa/org-ql/pull/220. Thanks to Akira Komamura (@akirak). --- tests/data.org | 2 +- tests/test-org-ql.el | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/data.org b/tests/data.org index b7a13cb..99875d8 100644 --- a/tests/data.org +++ b/tests/data.org @@ -81,7 +81,7 @@ SCHEDULED: <2017-07-05 Wed> If I don't, the frobnicator will probably fall off halfway to Mars... -Gotta buy one first, though. +Gotta buy one first, though. [[https://example.com/][This one]] looks suitable. * Recurring :PROPERTIES: diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index c9d560e..f273c57 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -644,7 +644,7 @@ RESULTS should be a list of strings as returned by (describe "(link)" (org-ql-it "without arguments" (org-ql-expect ('(link)) - '("/r/emacs"))) + '("Fix flux capacitor" "/r/emacs"))) (org-ql-it "with description-or-target" (org-ql-expect ('(link "emacs")) '("/r/emacs"))) @@ -656,6 +656,18 @@ RESULTS should be a list of strings as returned by '("/r/emacs"))) (org-ql-it "with :description and :target" (org-ql-expect ('(link :description "emacs" :target "reddit.com")) + '("/r/emacs"))) + (org-ql-it "with description-or-target regexp" + (org-ql-expect ('(link "em.cs" :regexp-p t)) + '("/r/emacs"))) + (org-ql-it "with :description regexp" + (org-ql-expect ('(link :description "em.cs" :regexp-p t)) + '("/r/emacs"))) + (org-ql-it "with :target regexp" + (org-ql-expect ('(link :target "em.cs" :regexp-p t)) + '("/r/emacs"))) + (org-ql-it "with :description and :target regexp" + (org-ql-expect ('(link :description "em.cs" :target "em.cs" :regexp-p t)) '("/r/emacs")))) (describe "(outline-path)"