review fixes: 3 blocking bugs + 2 improvements

B1: modern-backend now inherits from backend (was standalone class)
B2: draw-rect y-position bug — loop now tracks row offset
B3: Layout module added to ASDF system definition
I1: 6 smoke tests replaced with behavioral tests (captured output)
I3: 6 edge case tests: empty, single-child, zero-size, deep
    nesting, large padding, negative grow

Also fixed:
- Added missing make-simple-backend constructor to simple.lisp
- Added in-package to classes.lisp and simple.lisp (SBCL's load
  restores *package* after each load, breaking batch-mode loading)
This commit is contained in:
Hermes
2026-05-11 14:08:51 +00:00
parent 2231fb6647
commit 2b6fc32425
6 changed files with 153 additions and 46 deletions

View File

@@ -111,7 +111,7 @@
(case pos (:horizontal "─") (:vertical "│"))
"+"))))
(defclass modern-backend ()
(defclass modern-backend (backend)
((output-stream :initform *standard-output*
:accessor backend-output-stream)
(in-sync-p :initform nil :accessor in-sync-p)))
@@ -199,14 +199,14 @@
(backend-write b bot)))
(defmethod draw-rect ((b modern-backend) x y width height &key bg)
(let ((bg-esc (sgr-bg bg))
(reset (sgr-attr :reset))
(line (concatenate 'string
bg-esc
(make-string width :initial-element #\Space)
reset (string #\Newline))))
(loop repeat height do
(backend-write b (cursor-move-escape x y))
(let* ((bg-esc (sgr-bg bg))
(reset (sgr-attr :reset))
(line (concatenate 'string
bg-esc
(make-string width :initial-element #\Space)
reset (string #\Newline))))
(loop :for row :from 0 :below height :do
(backend-write b (cursor-move-escape x (+ y row)))
(backend-write b line))))
(defmethod draw-link ((b modern-backend) x y string url