Merge branch 'next' of git@github.com:h3rald/hex.git
h3rald h3rald@h3rald.com
Mon, 23 Dec 2024 17:38:36 +0100
1 files changed,
21 insertions(+),
5 deletions(-)
jump to
M
scripts/test.hex
→
scripts/test.hex
@@ -126,7 +126,7 @@
((args len 0x2 ==) ("two") ("no") if "two" ==) ((args len 0x3 !=) ("yes") when "yes" ==) (0x1 "tmp-a" : (tmp-a 0x3 <) (tmp-a 0x1 + "tmp-a" :) while tmp-a 0x3 ==) - //(0x0 "tmp-b" : (0x1 0x2 0x3) (tmp-b + "tmp-b" :) each tmp-b 0x6 ==) + ;(0x0 "tmp-b" : (0x1 0x2 0x3) (tmp-b + "tmp-b" :) each tmp-b 0x6 ==) ;60 ((0x2 0x0 /) (error "[symbol /] Division by zero" ==) try)@@ -136,8 +136,8 @@ ((0x1 0x2 0x3) (dup dup * *) map (0x1 0x8 0x1b) ==)
;64 (0x2 dup stack (0x2 0x2) ==) - // (clear stack () ==) - (0x1 0x2 swap pop stack (0x2) ==) + ;(clear stack () ==) + (0x1 0x2 swap pop pop pop stack (0x2) ==) ;68 (("aaa" "puts" :) (error) try "[symbol :] Failed to store symbol 'puts'" ==)@@ -226,7 +226,15 @@ ) "tests" :
; --- Run tests -tests (test .) each +0x0 "_c" : +(_c tests len <) + ( + tests _c get + test . + _c 0x1 + "_c" : + ) +while +"_c" # ; --- Report "\nSuccessful Tests: " print successes dec print "/" print successes failures + dec puts@@ -235,7 +243,15 @@
(errors len 0x0 >) ( "Errors:" warn - errors (warn) each + 0x0 "_c" : + (_c errors len <) + ( + errors _c get + warn + _c 0x1 + "_c" : + ) + while + "_c" # 0x1 "result" : ) when