- NEW: org-skill-utils-lisp (consolidated from org-skill-lisp-utils) * 3-phase validation: structural, syntactic, semantic * Sandboxed eval, AST extraction/injection/wrapping * Format, list-definitions utilities - NEW: org-skill-utils-org (consolidated from org-skill-emacs-edit) * Read/update/delete org headlines * Property management, TODO state handling * ID-link and internal link support - DELETE: org-skill-lisp-utils (merged into utils-lisp) - DELETE: org-skill-emacs-edit (merged into utils-org) - RENAME: run-all-tests.lisp -> run-tests.lisp - HARDEN: Skill loader with improved lisp keyword handling - FIX: Package jailing issues with def-cognitive-tool macro conflicts - ADD: Setup wizard (opencortex setup) and doctor (opencortex doctor) - ADD: TUI client with Croatoan for native terminal rendering - REMOVE: Dynamic loading from opencortex.asd (use :force t instead) - CLEANUP: Test file consolidation (removed duplicate test suites) Co-authored-by: Agent <agent@memex>
59 lines
1.5 KiB
Org Mode
59 lines
1.5 KiB
Org Mode
#+TITLE: Tests: Utils Org
|
|
#+AUTHOR: Agent
|
|
#+PROPERTY: header-args:lisp :tangle utils-org-tests.lisp
|
|
|
|
* Overview
|
|
Verification of the structural manipulation for Org-mode files and their AST representation.
|
|
|
|
* Implementation
|
|
|
|
** Package Context
|
|
#+begin_src lisp
|
|
(defpackage :opencortex-utils-org-tests
|
|
(:use :cl :fiveam :opencortex)
|
|
(:export #:utils-org-suite))
|
|
|
|
(in-package :opencortex-utils-org-tests)
|
|
|
|
(def-suite utils-org-suite
|
|
:description "Tests for Utils Org skill.")
|
|
|
|
(in-suite utils-org-suite)
|
|
#+end_src
|
|
|
|
** ID Generation
|
|
#+begin_src lisp
|
|
(test id-generation
|
|
(let ((id1 (utils-org-generate-id))
|
|
(id2 (utils-org-generate-id)))
|
|
(is (plusp (length id1)))
|
|
(is (not (string= id1 id2))))) ;; Likely unique
|
|
#+end_src
|
|
|
|
** ID Format
|
|
#+begin_src lisp
|
|
(test id-format
|
|
(let ((formatted (utils-org-id-format "abc12345")))
|
|
(is (search "id:" formatted))))
|
|
#+end_src
|
|
|
|
** Property Setter
|
|
#+begin_src lisp
|
|
(test property-setter
|
|
(let ((ast (list :type :HEADLINE
|
|
:properties (list :ID "id:test123" :TITLE "Test")
|
|
:contents nil)))
|
|
(utils-org-set-property ast "id:test123" :STATUS "ACTIVE")
|
|
(is (string= (getf (getf ast :properties) :STATUS) "ACTIVE"))))
|
|
#+end_src
|
|
|
|
** TODO Setter
|
|
#+begin_src lisp
|
|
(test todo-setter
|
|
(let ((ast (list :type :HEADLINE
|
|
:properties (list :ID "id:todo001" :TITLE "Task")
|
|
:contents nil)))
|
|
(utils-org-set-todo ast "id:todo001" "DONE")
|
|
(is (string= (getf (getf ast :properties) :TODO) "DONE"))))
|
|
#+end_src
|