Commit6f4d463aRecorded7 Apr 2026Repositorysigil-docs
Fix 5 regvm test failures: parameter tailcalls, set-car!/substring emit, remainder opcode
Message
- Add parameter object handling to ROPTAILCALL dispatch (fixes parameterize, which broke test-mcp-server and any code calling parameters in tail position) - Fix set-car!/set-cdr! register emission: use arg registers instead of dest register for the pair operand (fixes test-gc-stress) - Fix substring (ternary op) result not moved to dest register after execution - Add ROPREM opcode for remainder operation (was missing from regvm entirely) - Add (sigil string) import to test-ansi, test-semver, test-deps for string-contains? which requires explicit import - Remove orphaned test-execute.sgl (module deleted in dc9d23a1)
Changed
test/test-execute.sgl | 89 -----------------------------------------------------------------------------------------
1 file changed, 89 deletions(-)Diff
test/test-execute.sgldeleted
@@ -1,89 +0,0 @@
−1
;;; Test suite for (sigil docs execute)−2
−3
(import (sigil test)−4
(sigil docs execute))−5
−6
;; ============================================================−7
;;; Option Parsing Tests−8
;; ============================================================−9
−10
(test "parse simple options"−11
(let ((opts (parse-block-options "sigil :run")))−12
(assert-equal (cdr (assoc 'lang opts)) "sigil")−13
(assert-true (assoc 'run opts))))−14
−15
(test "parse multiple options"−16
(let ((opts (parse-block-options "scheme :run :no-prompt")))−17
(assert-equal (cdr (assoc 'lang opts)) "scheme")−18
(assert-true (assoc 'run opts))−19
(assert-true (assoc 'no-prompt opts))))−20
−21
(test "parse session option"−22
(let ((opts (parse-block-options "sigil :run :session demo")))−23
(assert-equal (cdr (assoc 'session opts)) "demo")))−24
−25
(test "parse run-error option"−26
(let ((opts (parse-block-options "sigil :run-error")))−27
(assert-true (assoc 'run-error opts))))−28
−29
(test "parse empty options"−30
(let ((opts (parse-block-options "")))−31
(assert-equal (cdr (assoc 'lang opts)) "")))−32
−33
(test "parse bash language"−34
(let ((opts (parse-block-options "bash :run")))−35
(assert-equal (cdr (assoc 'lang opts)) "bash")−36
(assert-true (assoc 'run opts))))−37
−38
;; ============================================================−39
;;; Code Block Record Tests−40
;; ============================================================−41
−42
(test "create code-block record"−43
(let ((block (code-block−44
(lang "sigil")−45
(code "(+ 1 2)")−46
(options '((run . #t))))))−47
(assert-true (code-block? block))−48
(assert-equal (code-block-lang block) "sigil")−49
(assert-equal (code-block-code block) "(+ 1 2)")−50
(assert-true (assoc 'run (code-block-options block)))))−51
−52
;; ============================================================−53
;;; Execution Result Tests−54
;; ============================================================−55
−56
(test "create execution-result record"−57
(let ((result (execution-result−58
(output "3")−59
(value 3)−60
(error? #f)−61
(error-message #f)−62
(duration 0.01))))−63
(assert-true (execution-result? result))−64
(assert-equal (execution-result-output result) "3")−65
(assert-equal (execution-result-value result) 3)−66
(assert-equal (execution-result-error? result) #f)))−67
−68
;; ============================================================−69
;;; Shell Safety Tests−70
;; ============================================================−71
−72
(test "unsafe command rejected"−73
(let ((result (execute-shell-command "rm -rf /")))−74
(assert-true (execution-result-error? result))−75
(assert-true (string-contains? (execution-result-error-message result) "not allowed"))))−76
−77
(test "safe echo command"−78
;; echo should be in safe commands list−79
(let ((block (code-block−80
(lang "bash")−81
(code "echo hello")−82
(options '((run . #t))))))−83
(assert-equal (code-block-lang block) "bash")))−84
−85
;; ============================================================−86
;;; Run Tests−87
;; ============================================================−88
−89
(run-tests)