Files
passepartout/tests/self-edit-tests.lisp
Amr Gharbeia 43dbe3cf2d
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 8s
feat(v0.2.0): Self-Improvement & Structural Integrity
- Fix critical paren balance issues across harness/skills.org, act.org,
  loop.org, memory.org, and skills/self-edit|emacs-edit.org
- Add :reload-skill cognitive tool for hot-reloading without restart
- Add :generate-embeddings tool and self-edit hot-reload infrastructure
- Wire all new skills (self-edit, emacs-edit, lisp-utils) into main ASDF
- Regenerate all .lisp tangled files via emacs --batch org-babel-tangle
- Add :opencortex/tests ASDF system with 14 test suites
- Fix test files to compile cleanly (self-edit-tests symbol vis, etc.)
2026-04-27 07:30:01 -04:00

35 lines
1.1 KiB
Common Lisp

(defpackage :opencortex-self-edit-tests
(:use :cl :fiveam :opencortex)
(:export #:self-edit-suite))
(in-package :opencortex-self-edit-tests)
(def-suite self-edit-suite
:description "Tests for Self-Edit skill.")
(in-suite self-edit-suite)
(test balance-parens-balanced
(let ((result (opencortex::self-edit-balance-parens "(+ 1 2)")))
(is (string= result "(+ 1 2)"))
(is (not (null (read-from-string result))))))
(test balance-parens-missing-open
(let ((result (opencortex::self-edit-balance-parens "+ 1 2)")))
(is (string= result "(+ 1 2)"))
(is (not (null (read-from-string result))))))
(test balance-parens-missing-close
(let ((result (opencortex::self-edit-balance-parens "(+ 1 2")))
(is (string= result "(+ 1 2)"))
(is (not (null (read-from-string result))))))
(test balance-parens-deep
(let ((result (opencortex::self-edit-balance-parens "((lambda (x) (if x (+ 1 2) 3))")))
(is (string= result "((lambda (x) (if x (+ 1 2) 3)))"))
(is (not (null (read-from-string result))))))
(test balance-parens-empty
(let ((result (opencortex::self-edit-balance-parens "")))
(is (string= result ""))))