forth: SP@ / SP! (+4; Hayes 174/590)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
This commit is contained in:
@@ -171,6 +171,24 @@
|
||||
((r (forth-run "1000 2 ACCEPT")))
|
||||
(let ((stk (nth r 2))) (forth-p4-assert "ACCEPT empty buf -> 0" (list 0) stk)))))
|
||||
|
||||
(define
|
||||
forth-p4-sp-tests
|
||||
(fn
|
||||
()
|
||||
(forth-p4-check-top "SP@ returns depth (0)" "SP@" 0)
|
||||
(forth-p4-check-top
|
||||
"SP@ after pushes"
|
||||
"1 2 3 SP@ SWAP DROP SWAP DROP SWAP DROP"
|
||||
3)
|
||||
(forth-p4-check-stack-size
|
||||
"SP! truncates"
|
||||
"1 2 3 4 5 2 SP!"
|
||||
2)
|
||||
(forth-p4-check-top
|
||||
"SP! leaves base items intact"
|
||||
"1 2 3 4 5 2 SP!"
|
||||
2)))
|
||||
|
||||
(define
|
||||
forth-p4-base-tests
|
||||
(fn
|
||||
@@ -227,6 +245,7 @@
|
||||
(forth-p4-char-tests)
|
||||
(forth-p4-key-accept-tests)
|
||||
(forth-p4-base-tests)
|
||||
(forth-p4-sp-tests)
|
||||
(dict
|
||||
"passed"
|
||||
forth-p4-passed
|
||||
|
||||
Reference in New Issue
Block a user