Tests and fixes.1
h3rald h3rald@h3rald.com
Sun, 01 Dec 2024 06:50:31 +0000
M
hex.c
→
hex.c
@@ -3476,16 +3476,15 @@ }
} if (hex_push_quotation(ctx, quotation, count) != 0) { + hex_error(ctx, "An error occurred while filtering the list"); FREE(ctx, action); FREE(ctx, list); - return 1; + for (int i = 0; i < count; i++) + { + FREE(ctx, *quotation[i]); + } + return 1 ; } - hex_error(ctx, "An error occurred while filtering the list"); - for (int i = 0; i < count; i++) - { - FREE(ctx, *quotation[i]); - } - return 1; } return 0; }
M
test.hex
→
test.hex
@@ -98,7 +98,7 @@ ((0x1 0x2 0x3) 0x4 0x3 insert (0x1 0x2 0x3 0x4) ==)
;44 ("this is a test" "is" index 0x2 ==) - (("a" 0x1 "b") "b" index 0x2) + (("a" 0x1 "b") "b" index 0x2 ==) ("abc" "d" index 0xffffffff ==) (("0" "0" "0" "0") "." join "0.0.0.0"==) ;48@@ -109,10 +109,34 @@ ("test" "test.txt" write "test.txt" read "test" ==)
("!" "test.txt" append "test.txt" read "test!" ==) ;52 - ("rm test.txt" exec 0x1) - + ("rm test.txt" exec 0x0 ==) + ("rm test.txt" run 0x0 get 0x1 ==) + ("ls web/contents" run 0x1 get "\n" split len 0x6 ==) + (args 0x1 get "test.hex" ==) + ;56 + + ((args len 0x2 ==) ("two") ("no") if "two" ==) + ((args len 0x3 !=) ("yes") when "yes" ==) + (0x1 "tmp_a" store (tmp_a 0x3 <) (tmp_a 0x1 + "tmp_a" store) while tmp_a 0x3 ==) + (0x0 "tmp_b" store (0x1 0x2 0x3) (tmp_b + "tmp_b" store) each tmp_b 0x6 ==) + ;60 + + ((0x2 0x0 /) (error "Division by zero" ==) try) + (error "" ==) + ("a" q q q ((("a"))) ==) + ((0x1 0x2 0x3) (dup dup * *) map (0x1 0x8 0x1b) ==) + ;64 + + ((0x1 0x2 0x3) (0x2 % 0x0 ==) filter (0x2) ==) + (0x2 dup stack (0x2 0x2) ==) + (clear stack () ==) + (0x1 0x2 swap pop stack (0x2) ==) + ;68 ) "tests" store + +; Cleanup +clear ; --- Run tests