Added more tests.
h3rald h3rald@h3rald.com
Sat, 30 Nov 2024 16:11:32 +0100
M
hex.c
→
hex.c
@@ -2618,7 +2618,7 @@ {
FILE *file = fopen(filename.data.strValue, "r"); if (!file) { - hex_error(ctx, "Could not open file: %s", filename.data.strValue); + hex_error(ctx, "Could not open file for reading: %s", filename.data.strValue); result = 1; } else@@ -3973,7 +3973,7 @@ printf("*** Debug mode enabled ***\n");
} else if ((strcmp(arg, "-h") == 0 || strcmp(arg, "--help") == 0)) { - hex_print_help(&ctx.docs); + hex_print_help(); return 0; } else if ((strcmp(arg, "-m") == 0 || strcmp(arg, "--manual") == 0))
M
tests.hex
→
tests.hex
@@ -97,8 +97,20 @@ ("abcde" "f" 0x5 insert "abcdef" ==)
((0x1 0x2 0x3) 0x4 0x3 insert (0x1 0x2 0x3 0x4) ==) ;44 - ;("this is a test" "is" index 0x6 ==) + ("this is a test" "is" index 0x2 ==) (("a" 0x1 "b") "b" index 0x2) + ("abc" "d" index 0xffffffff ==) + (("0" "0" "0" "0") "." join "0.0.0.0"==) + ;48 + + ("0.0.0.0" "." split ("0" "0" "0" "0") ==) + ("Hello, World!" "Hello" "Goodbye" replace "Goodbye, World!" ==) + ("test" "test.txt" write "test.txt" read "test" ==) + ("!" "test.txt" append "test.txt" read "test!" ==) + ;52 + + ("rm test.txt" exec 0x1) + ) "tests" store