branch: externals/org-real commit add82f374b45c9c1dc82bd3984eaa0d1029b9890 Author: Tyler Grinn <tylergr...@gmail.com> Commit: Tyler Grinn <tylergr...@gmail.com>
Added smoke test; fixed behind preposition --- org-real.el | 41 +++++++++----- tests/smoke-test.org | 147 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 175 insertions(+), 13 deletions(-) diff --git a/org-real.el b/org-real.el index c08f2b9..2073472 100644 --- a/org-real.el +++ b/org-real.el @@ -944,23 +944,37 @@ button drawn." (current-column)))) (delete-char (min (length str) remaining-chars))))))) (draw (cons top left) - (concat (if double "╔" "┌") - (make-string (- width 2) (cond (dashed #x254c) + (concat (cond ((and double dashed) "┏") + (double "╔") + (t "┌")) + (make-string (- width 2) (cond ((and double dashed) #x2505) + (dashed #x254c) (double #x2550) (t #x2500))) - (if double "╗" "┐"))) + (cond ((and double dashed) "┓") + (double "╗") + (t "┐")))) (if align-bottom (draw (cons (+ top height) left) - (concat (if double "╨" "┴") + (concat (cond ((and double dashed) "┸") + (double "╨") + (t "┴")) (make-string (- width 2) (cond (dashed #x254c) (t #x2500))) - (if double "╨" "┴"))) + (cond ((and double dashed) "┸") + (double "╨") + (t "┴")))) (draw (cons (+ top height -1) left) - (concat (if double "╚" "└") - (make-string (- width 2) (cond (dashed #x254c) + (concat (cond ((and double dashed) "┗") + (double "╚") + (t "└")) + (make-string (- width 2) (cond ((and double dashed) #x2505) + (dashed #x254c) (double #x2550) (t #x2500))) - (if double "╝" "┘")))) + (cond ((and double dashed) "┛") + (double "╝") + (t "┘"))))) (draw-name (cons (+ top 1 org-real-padding-y) (+ left 1 org-real-padding-x)) name @@ -969,10 +983,12 @@ button drawn." (c1 left) (c2 (+ left width -1))) (dotimes (_ (- height (if align-bottom 1 2))) - (draw (cons r c1) (cond (dashed "╎") + (draw (cons r c1) (cond ((and double dashed) "┇") + (dashed "╎") (double "║") (t "│"))) - (draw (cons r c2) (cond (dashed "╎") + (draw (cons r c2) (cond ((and double dashed) "┇") + (dashed "╎") (double "║") (t "│"))) (setq r (+ r 1)))))))) @@ -1547,8 +1563,9 @@ NEXT." ((or next-on-top next-in-front) (setq next-level (+ 1 prev-level)) (setq next-behind prev-behind)) - ((member rel '("in" "on" "behind")) + ((member rel '("in" "on")) (setq flex t) + (setq next-behind prev-behind) (setq next-level (+ 1 prev-level))) ((string= rel "behind") (setq flex t) @@ -1652,8 +1669,6 @@ characters if possible." max))))) all-siblings (org-real-box :y-order -1.0e+INF))))) - (oset box :flex t) - (oset box :behind parent-behind) (org-real--apply-level box level) (org-real--add-child parent box t) (org-real--flex-adjust box world) diff --git a/tests/smoke-test.org b/tests/smoke-test.org new file mode 100644 index 0000000..f5ad46e --- /dev/null +++ b/tests/smoke-test.org @@ -0,0 +1,147 @@ +#+TODO: FAIL | PASS + +* Opening links + +** PASS [[real://1-2/1-1][in]] + #+begin_example + + The 1-1 is in the 1-2. + + ┌─────────────┐ + │ │ + │ 1-2 │ + │ │ + │ ┌───────┐ │ + │ │ │ │ + │ │ 1-1 │ │ + │ │ │ │ + │ └───────┘ │ + └─────────────┘ + #+end_example + +** PASS [[real://2-2/2-1?rel=on][on]] + #+begin_example + + The 2-1 is on the 2-2. + + ┌─────────────┐ + │ │ + │ 2-2 │ + │ │ + │ ┌───────┐ │ + │ │ │ │ + │ │ 2-1 │ │ + │ │ │ │ + │ └───────┘ │ + └─────────────┘ + #+end_example + +** PASS [[real://3-2/3-1?rel=behind][behind]] + #+begin_example + + The 3-1 is behind the 3-2. + + ┌─────────────┐ + │ │ + │ 3-2 │ + │ │ + │ ┌╌╌╌╌╌╌╌┐ │ + │ ╎ ╎ │ + │ ╎ 3-1 ╎ │ + │ ╎ ╎ │ + │ └╌╌╌╌╌╌╌┘ │ + └─────────────┘ + #+end_example + +** PASS [[real://4-2/4-1?rel=in front of][in front of]] + #+begin_example + + The 4-1 is in front of the 4-2. + + ┌─────────────┐ + │ │ + │ 4-2 │ + │ │ + │ ┌───────┐ │ + │ │ │ │ + │ │ 4-1 │ │ + │ │ │ │ + └──┴───────┴──┘ + #+end_example + +** PASS [[real://5-2/5-1?rel=above][above]] + #+begin_example + + The 5-1 is above the 5-2. + + ┌───────┐ + │ │ + │ 5-1 │ + │ │ + └───────┘ + + ┌───────┐ + │ │ + │ 5-2 │ + │ │ + └───────┘ + #+end_example + +** PASS [[real://6-2/6-1?rel=below][below]] + #+begin_example + + The 6-1 is below the 6-2. + + ┌───────┐ + │ │ + │ 6-2 │ + │ │ + └───────┘ + + ┌───────┐ + │ │ + │ 6-1 │ + │ │ + └───────┘ + #+end_example + + +** PASS [[real://7-2/7-1?rel=to the left of][left]] + #+begin_example + + The 7-1 is to the left of the 7-2. + + ┌───────┐ ┌───────┐ + │ │ │ │ + │ 7-1 │ │ 7-2 │ + │ │ │ │ + └───────┘ └───────┘ + #+end_example + +** PASS [[real://8-2/8-1?rel=to the right of][right]] + #+begin_example + + The 8-1 is to the right of the 8-2. + + ┌───────┐ ┌───────┐ + │ │ │ │ + │ 8-2 │ │ 8-1 │ + │ │ │ │ + └───────┘ └───────┘ + #+end_example + +** PASS [[real://9-2/9-1?rel=on top of][on top]] + #+begin_example + + The 9-1 is on top of the 9-2. + + ┌───────┐ + │ │ + │ 9-1 │ + │ │ + ┌──┴───────┴──┐ + │ │ + │ 9-2 │ + │ │ + └─────────────┘ + #+end_example