From eb84acd778a0948f88709c9d368e49ef37c5d9a2 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Tue, 7 Jun 2022 23:12:03 -0400 Subject: [PATCH] ADD barely useful dag test suite --- local/lib/org-x/test/org-x-dag-test.el | 52 ++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 local/lib/org-x/test/org-x-dag-test.el diff --git a/local/lib/org-x/test/org-x-dag-test.el b/local/lib/org-x/test/org-x-dag-test.el new file mode 100644 index 0000000..e4fd461 --- /dev/null +++ b/local/lib/org-x/test/org-x-dag-test.el @@ -0,0 +1,52 @@ +;;; org-x-dag-test.el --- Smesh my API -*- lexical-binding: t -*- + +;; Copyright (C) 2015 Free Software Foundation, Inc. + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; run tests with this (in the org-x directory above this one): + +;; emacs -batch -l ../../../init.el -l test/org-x-dag-test.el -f buttercup-run + +;;; Code: + +(require 's) +(require 'dash) +(require 'org-x) + +(defun setup () + (setq org-directory "test/dag" + org-x-action-files (list "action1.org" "action2.org") + org-x-endpoint-goal-file "endpoint.org" + org-x-lifetime-goal-file "lifetime.org" + org-x-survival-goal-file "survival.org" + org-x-daily-plan-file "daily.org" + org-x-weekly-plan-file "weekly.org" + org-x-quarterly-plan-file "quarterly.org")) + +(describe "Sync DAG" + ;; TODO this won't actually fail if there is an error + (it "Sync completes without error" + (setup) + (org-x-dag-sync t)) + + (it "One random hash is present in the dag" + (expect (org-x-dag-id->title "06592f95-9cf5-4d7e-8546-da7796d76813") + :to-equal + "don't be a dick"))) + +(provide 'org-x-dag-test) +;;; org-x-dag-test.el ends here