Mercurial > core / lisp/lib/organ/tests.lisp
changeset 698: |
96958d3eb5b0 |
parent: |
7ca4cdbd52c2
|
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Fri, 04 Oct 2024 22:04:59 -0400 |
permissions: |
-rw-r--r-- |
description: |
fixes |
1 (defpackage :organ/tests 2 (:use :cl :organ :std :rt) 3 (:export *test-org-file*)) 5 (in-package :organ/tests) 7 (defparameter *test-org-heading* 8 #"* TODO [#A] header1 :tag1:tag2: 15 (defparameter *test-org-section* 16 "Paragraph with /italics/ *bold* =verbatim= ~code~ _underline_ +strike-through+. 19 (print \"hello world\") 22 (defparameter *test-org-lines* 35 (deftest org-markup () 36 "Test org markup in a paragraph." 37 (let ((lines (read-org-lines-from-string *test-org-lines*))) 38 (is (org-parse :plain-text (aref lines 0))) 39 (is (org-parse :italic (aref lines 1))) 40 (is (org-parse :bold (aref lines 2))) 41 (is (org-parse :verbatim (aref lines 3))) 42 (is (org-parse :code (aref lines 4))) 43 (is (org-parse :underline (aref lines 5))) 44 (is (org-parse :strike-through (aref lines 6)))) 45 ;; should return vector of ORG-OBJECTs 46 (is (typep (org-contents (org-parse :paragraph *test-org-lines*)) 'vector))) 48 (deftest org-minimal ()) 50 (deftest org-standard ()) 52 (defun headline-ok (hl) 54 (> (organ::hl-stars hl) 0) 56 (organ::hl-priority hl) 58 (> (length (organ::hl-tags hl)) 0))) 61 (deftest org-headline () (is (headline-ok (org-parse :headline "** DONE [#A] testing stuff :foo:bar:")))) 64 (deftest org-heading () 65 (is (headline-ok (org-headline (org-parse :heading *test-org-heading*))))) 67 (deftest org-section ()) 69 (deftest org-document ()) 72 (is (vectorp (read-org-lines-from-string *test-org-heading*))))