Testing hex_symbol_try.
h3rald h3rald@h3rald.com
Sun, 24 Nov 2024 13:34:09 +0100
4 files changed,
13 insertions(+),
8 deletions(-)
M
hex.c
→
hex.c
@@ -794,7 +794,7 @@ // Ignore comments
} else { - hex_error("Unexpected token in quotation: >>%s<<", token->value); + hex_error("Unexpected token in quotation: %d", token->value); hex_free_token(token); free(quotation); return 1;@@ -3209,9 +3209,11 @@
HEX_ERRORS = 0; for (int i = 0; i < tryBlock.quotationSize; i++) { + printf("-> "); + hex_print_element(stdout, *tryBlock.data.quotationValue[i]); + printf("\n"); if (hex_push(*tryBlock.data.quotationValue[i]) != 0) { - result = 1; break; } }
M
tests.hex
→
tests.hex
@@ -5,7 +5,7 @@ () "errors" store
( "current-test" store - test-count 0x1 + "test-counnt" store + test-count 0x1 + "test-count" store ( (current-test i) (@@ -20,7 +20,7 @@ if
) ( ; Store error - errors test-count str " - " concat error concat q concat "errors" store + ;errors test-count str " - " concat error concat q concat "errors" store "x" print failures 0x1 + "failures" store )@@ -28,14 +28,14 @@ try
) "test" store ; --- Tests -(0x1 "a" store a 0x1 == dup) test i +;(0x1 "a" store a 0x1 == dup) test i (a free 0x1) test i ; --- Report "\nSuccessful Tests: " print successes dec print "/" print successes failures + dec puts -(errors length 0 >) - errors (warn) each +(errors len 0x0 >) + (errors (warn) each) when ; --- Cleanup