From 2447c5452ad0ae65c67031c3d3a6555cde5c3960 Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Mon, 8 Jul 2024 14:31:06 +0200 Subject: [PATCH 1/3] tests: examples/quicksort.ark takes the number of repetitions by argument --- examples/quicksort.ark | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/quicksort.ark b/examples/quicksort.ark index 6e4c102e3..a1eb5180b 100644 --- a/examples/quicksort.ark +++ b/examples/quicksort.ark @@ -31,11 +31,12 @@ # an unsorted list to sort (let a [3 6 1 5 1 65 324 765 1 6 3 0 6 9 6 5 3 2 5 6 7 64 645 7 345 432 432 4 324 23]) +(let rep (if (>= (len sys:args) 1) (toNumber (@ sys:args 0)) 1)) + # a benchmarking function, to see the difference between C++ sort and ArkScript quicksort # obviously ArkScript will be a bit slower (let bench (fun (name code) { (mut start (time)) - (let rep 1000) (mut i 0) (while (< i rep) { From 7fdd908c102951d04e856ea1815a4f89ad9ab394 Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Mon, 8 Jul 2024 14:32:35 +0200 Subject: [PATCH 2/3] feat(tools, fuzzing): update afl scripts and add an option to easily regenerate the corpus --- ...-build-with-afl.sh => 0-build-with-afl.sh} | 0 ...-prepare-corpus.sh => 1-prepare-corpus.sh} | 2 + tests/fuzzing/docker/build-and-make-corpus.sh | 16 ++++++ tests/fuzzing/docker/setup-container.sh | 2 +- tests/fuzzing/glob_all_ark_files.py | 22 ++++++++ tests/fuzzing/start-afl-docker.sh | 51 +++++++++++++++---- 6 files changed, 81 insertions(+), 12 deletions(-) rename tests/fuzzing/docker/{1-build-with-afl.sh => 0-build-with-afl.sh} (100%) rename tests/fuzzing/docker/{0-prepare-corpus.sh => 1-prepare-corpus.sh} (95%) create mode 100755 tests/fuzzing/docker/build-and-make-corpus.sh create mode 100644 tests/fuzzing/glob_all_ark_files.py diff --git a/tests/fuzzing/docker/1-build-with-afl.sh b/tests/fuzzing/docker/0-build-with-afl.sh similarity index 100% rename from tests/fuzzing/docker/1-build-with-afl.sh rename to tests/fuzzing/docker/0-build-with-afl.sh diff --git a/tests/fuzzing/docker/0-prepare-corpus.sh b/tests/fuzzing/docker/1-prepare-corpus.sh similarity index 95% rename from tests/fuzzing/docker/0-prepare-corpus.sh rename to tests/fuzzing/docker/1-prepare-corpus.sh index b8f21feb3..4fc049408 100755 --- a/tests/fuzzing/docker/0-prepare-corpus.sh +++ b/tests/fuzzing/docker/1-prepare-corpus.sh @@ -10,6 +10,8 @@ fi exe=$(pwd)/build/arkscript ark_lib=$(pwd)/lib +export AFL_MAP_SIZE=223723 + rm -rf tests/fuzzing/corpus-cmin/* rm -rf tests/fuzzing/corpus-cmin-tmin/* afl-cmin -i tests/fuzzing/corpus -o tests/fuzzing/corpus-cmin -T all -- "$exe" @@ -L "$ark_lib" diff --git a/tests/fuzzing/docker/build-and-make-corpus.sh b/tests/fuzzing/docker/build-and-make-corpus.sh new file mode 100755 index 000000000..6e043f747 --- /dev/null +++ b/tests/fuzzing/docker/build-and-make-corpus.sh @@ -0,0 +1,16 @@ +if ! [ -f /.dockerenv ]; then + echo "This script needs to run inside the aflplusplus docker container" + exit 1 +fi + +cd /src || exit 1 + +################################################### +# Build ArkScript +################################################### +source ./tests/fuzzing/docker/0-build-with-afl.sh + +################################################### +# Generate corpus +################################################### +source ./tests/fuzzing/docker/1-prepare-corpus.sh diff --git a/tests/fuzzing/docker/setup-container.sh b/tests/fuzzing/docker/setup-container.sh index 004f1b7c3..23be4904e 100644 --- a/tests/fuzzing/docker/setup-container.sh +++ b/tests/fuzzing/docker/setup-container.sh @@ -15,7 +15,7 @@ apt install -yq tmux ################################################### # Build ArkScript ################################################### -source ./tests/fuzzing/docker/1-build-with-afl.sh +source ./tests/fuzzing/docker/0-build-with-afl.sh ################################################### # Launch the fuzzers diff --git a/tests/fuzzing/glob_all_ark_files.py b/tests/fuzzing/glob_all_ark_files.py new file mode 100644 index 000000000..7b01049f7 --- /dev/null +++ b/tests/fuzzing/glob_all_ark_files.py @@ -0,0 +1,22 @@ +import glob + + +def exclude(file: str): + return all(not file.startswith(path) for path in [ + "lib/", + "output/", + "fuzzing/", + "fct-bad/", + "fct-ok/", + "tests/fuzzing/", + "a.ark", + "b.ark" + ]) + + +for file in glob.glob("**/*.ark", recursive=True): + if exclude(file): + new_filename = file.replace("/", "_").lower() + with open(f"tests/fuzzing/corpus/{new_filename}", "w") as f: + with open(file) as source: + f.write(source.read()) diff --git a/tests/fuzzing/start-afl-docker.sh b/tests/fuzzing/start-afl-docker.sh index 51ee124a3..4c5cec7e7 100755 --- a/tests/fuzzing/start-afl-docker.sh +++ b/tests/fuzzing/start-afl-docker.sh @@ -7,15 +7,44 @@ if [[ "$TERM" =~ "screen".* ]]; then exit 1 fi +start_afl_with_ramdisk() { + # we need a ton of ramdisks, one per fuzzer, to avoid killing the + # disk with millions of writes when cmin/tmin/fuzz are running + docker run -it --rm --name afldocker \ + --mount type=tmpfs,destination=/ramdisk0 \ + --mount type=tmpfs,destination=/ramdisk1 \ + --mount type=tmpfs,destination=/ramdisk2 \ + --mount type=tmpfs,destination=/ramdisk3 \ + --mount type=tmpfs,destination=/ramdisk4 \ + -v $(pwd):/src \ + aflplusplus/aflplusplus:v4.20c \ + bash /src/tests/fuzzing/docker/setup-container.sh +} -# we need a ton of ramdisks, one per fuzzer, to avoid killing the -# disk with millions of writes when cmin/tmin/fuzz are running -docker run -it --rm --name afldocker \ - --mount type=tmpfs,destination=/ramdisk0 \ - --mount type=tmpfs,destination=/ramdisk1 \ - --mount type=tmpfs,destination=/ramdisk2 \ - --mount type=tmpfs,destination=/ramdisk3 \ - --mount type=tmpfs,destination=/ramdisk4 \ - -v $(pwd):/src \ - aflplusplus/aflplusplus:v4.20c \ - bash /src/tests/fuzzing/docker/setup-container.sh +generate_corpus_in_docker() { + docker run -it --rm --name afldocker \ + --mount type=tmpfs,destination=/ramdisk0 \ + -e AFL_TMPDIR=/ramdisk0 \ + -v $(pwd):/src \ + aflplusplus/aflplusplus:v4.20c \ + bash /src/tests/fuzzing/docker/build-and-make-corpus.sh +} + +if [[ $# == 1 ]]; then + case $1 in + fuzz) + start_afl_with_ramdisk + ;; + corpus) + python3 tests/fuzzing/glob_all_ark_files.py + generate_corpus_in_docker + ;; + *) + echo "Usage: start-afl-docker.sh [mode]" + echo " fuzz: start afldocker with ramdisk and run the fuzzers" + echo " corpus: compute a corpus from tests/fuzzing/corpus/" + ;; + esac +else + start_afl_with_ramdisk +fi From db5121ad167a8655836c3621282219abb8f0915f Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Mon, 8 Jul 2024 15:34:06 +0200 Subject: [PATCH 3/3] feat(fuzzing): updating corpus --- .../corpus-cmin-tmin/argcount_unknown_arg.ark | 13 - tests/fuzzing/corpus-cmin-tmin/async_test.ark | 29 -- .../corpus-cmin-tmin/builtins-list.ark | 20 -- .../fuzzing/corpus-cmin-tmin/builtins-str.ark | 9 - tests/fuzzing/corpus-cmin-tmin/closures2.ark | 15 - .../comments_after_import.ark | 1 - .../corpus-cmin-tmin/comments_after_while.ark | 7 - .../corpus-cmin-tmin/examples_blockchain.ark | 168 +++++++++ .../{callbacks.ark => examples_callbacks.ark} | 6 +- .../{collatz.ark => examples_collatz.ark} | 2 +- .../examples_games_game_of_life.ark | 69 ++++ .../examples_games_snake_snake.ark | 180 ++++++++++ .../corpus-cmin-tmin/examples_http.ark | 52 +++ .../examples_more-or-less.ark | 25 ++ .../corpus-cmin-tmin/examples_quicksort.ark | 53 +++ ...sum_digits.ark => examples_sum_digits.ark} | 11 +- tests/fuzzing/corpus-cmin-tmin/fibo.ark | 9 - .../fuzzing/corpus-cmin-tmin/huge_number.ark | 1 - .../corpus-cmin-tmin/incomplete_arguments.ark | 1 - .../corpus-cmin-tmin/incomplete_begin.ark | 1 - .../corpus-cmin-tmin/incomplete_call.ark | 1 - .../corpus-cmin-tmin/incomplete_del.ark | 1 - .../corpus-cmin-tmin/incomplete_fun.ark | 1 - .../corpus-cmin-tmin/incomplete_import_1.ark | 1 - .../corpus-cmin-tmin/incomplete_import_2.ark | 1 - .../corpus-cmin-tmin/incomplete_let.ark | 2 - .../corpus-cmin-tmin/incomplete_macro.ark | 1 - .../incomplete_macro_arguments.ark | 1 - .../incomplete_macro_spread.ark | 1 - .../incomplete_package_name.ark | 1 - .../corpus-cmin-tmin/incomplete_string.ark | 1 - .../incorrect_arg_capture.ark | 1 - .../corpus-cmin-tmin/incorrect_escape_seq.ark | 1 - .../corpus-cmin-tmin/incorrect_import.ark | 1 - .../fuzzing/corpus-cmin-tmin/invalid_let.ark | 7 - tests/fuzzing/corpus-cmin-tmin/let_atom.ark | 14 - tests/fuzzing/corpus-cmin-tmin/list1.ark | 20 -- tests/fuzzing/corpus-cmin-tmin/list2.ark | 17 - tests/fuzzing/corpus-cmin-tmin/list3.ark | 17 - tests/fuzzing/corpus-cmin-tmin/list4.ark | 28 -- tests/fuzzing/corpus-cmin-tmin/loop.ark | 10 - tests/fuzzing/corpus-cmin-tmin/macro_cond.ark | 2 - .../corpus-cmin-tmin/nil_not_a_function.ark | 2 - .../fuzzing/corpus-cmin-tmin/not_callable.ark | 1 - .../not_enough_args_macro.ark | 4 - .../not_enough_args_operator.ark | 1 - tests/fuzzing/corpus-cmin-tmin/quicksort.ark | 46 --- tests/fuzzing/corpus-cmin-tmin/string.ark | 10 - .../tests_arkscript_async-tests.ark | 41 +++ .../tests_arkscript_builtins-tests.ark | 65 ++++ .../tests_arkscript_list-tests.ark | 72 ++++ .../tests_arkscript_macro-tests.ark | 136 ++++++++ .../tests_arkscript_string-tests.ark | 14 + .../tests_arkscript_unittests.ark | 7 + .../tests_arkscript_utf8-tests.ark | 32 ++ .../tests_arkscript_vm-tests.ark | 139 ++++++++ .../tests_benchmarks_resources_parser_big.ark | 318 ++++++++++++++++++ ...sts_benchmarks_resources_parser_medium.ark | 25 ++ ...sts_benchmarks_resources_parser_simple.ark | 12 + ...benchmarks_resources_runtime_fibonacci.ark | 5 + ...arks_resources_runtime_man_or_boy_test.ark | 9 + ...benchmarks_resources_runtime_quicksort.ark | 21 ++ ...ests_errors_callable_arity_error_async.ark | 4 + ...sts_errors_callable_fmt_arg_not_found.ark} | 0 .../tests_errors_callable_not_callable.ark | 1 + ...tests_errors_callable_not_enough_args.ark} | 2 +- ...tests_errors_callable_recursion_depth.ark} | 0 .../tests_errors_callable_too_many_args.ark | 2 + ... => tests_errors_capture_can_not_call.ark} | 0 .../tests_errors_capture_unbound.ark | 1 + .../tests_errors_compiler_import_too_long.ark | 1 + ...ests_errors_compiler_invalid_codepoint.ark | 1 + ...sts_errors_compiler_invalid_escape_seq.ark | 1 + .../tests_errors_compiler_invalid_func.ark | 1 + .../tests_errors_compiler_invalid_let.ark | 7 + ...s_errors_compiler_invalid_node_in_call.ark | 2 + ...s_errors_compiler_invalid_node_in_list.ark | 1 + ...ts_errors_compiler_invalid_node_in_ope.ark | 1 + ...ors_compiler_invalid_node_in_tail_call.ark | 2 + .../tests_errors_compiler_invalid_while.ark | 3 + ...k => tests_errors_compiler_let_no_sym.ark} | 0 ...ts_errors_compiler_sub_import_too_long.ark | 1 + .../tests_errors_compiler_type_no_args.ark | 1 + ...tests_errors_compiler_well_formed_args.ark | 2 + ...=> tests_errors_index_at_out_of_range.ark} | 0 ...ests_errors_index_at_str_out_of_range.ark} | 0 ...> tests_errors_index_pop_out_of_range.ark} | 0 ...sts_errors_macros_argcount_unknown_arg.ark | 13 + ...> tests_errors_macros_at_out_of_range.ark} | 0 .../tests_errors_macros_duplicated_arg.ark | 17 + ...sts_errors_macros_invalid_let_in_macro.ark | 3 + ...sts_errors_macros_invalid_sym_func_def.ark | 2 + .../tests_errors_macros_max_depth.ark | 2 + ...ts_errors_macros_max_unification_depth.ark | 20 ++ .../tests_errors_macros_not_enough_args.ark | 4 + ... => tests_errors_macros_too_many_args.ark} | 2 +- ...tests_errors_macros_unevaluated_spread.ark | 4 + ...sts_errors_mutability_append_in_place.ark} | 2 +- ...sts_errors_mutability_concat_in_place.ark} | 0 ... tests_errors_mutability_pop_in_place.ark} | 0 ...k => tests_errors_mutability_redefine.ark} | 0 ...> tests_errors_mutability_self_concat.ark} | 0 ... => tests_errors_mutability_set_const.ark} | 0 ...db0.ark => tests_errors_operators_db0.ark} | 0 ...> tests_errors_operators_freestanding.ark} | 0 ...ark => tests_errors_operators_no_args.ark} | 0 ...tests_errors_operators_not_enough_args.ark | 1 + ...ark => tests_errors_scope_del_unbound.ark} | 0 ...ark => tests_errors_scope_set_unbound.ark} | 0 ...und.ark => tests_errors_scope_unbound.ark} | 0 .../tests_errors_type_nil_not_a_function.ark | 2 + ...rk => tests_errors_type_not_a_closure.ark} | 0 ...rk => tests_errors_type_unknown_field.ark} | 0 ...nittests_resources_astsuite_99bottles.ark} | 9 +- ...nittests_resources_astsuite_ackermann.ark} | 17 +- ...unittests_resources_astsuite_closures.ark} | 30 +- ...ts_unittests_resources_astsuite_error.ark} | 6 +- ...nittests_resources_astsuite_factorial.ark} | 4 +- ...s_unittests_resources_astsuite_macros.ark} | 39 ++- ...ttests_resources_formattersuite_calls.ark} | 5 +- ...formattersuite_comment_after_macro_arg.ark | 5 + ...rmattersuite_comment_after_macro_cond.ark} | 2 +- ...es_formattersuite_comments_after_call.ark} | 6 +- ...es_formattersuite_comments_after_cond.ark} | 4 +- ...s_formattersuite_comments_after_import.ark | 1 + ...ormattersuite_comments_after_variable.ark} | 4 +- ...s_resources_formattersuite_conditions.ark} | 2 +- ...unittests_resources_formattersuite_del.ark | 3 + ...ttests_resources_formattersuite_field.ark} | 2 +- ...ts_resources_formattersuite_functions.ark} | 4 +- ...ests_resources_formattersuite_imports.ark} | 6 +- ...ts_resources_formattersuite_macro_cond.ark | 2 + ...tests_resources_formattersuite_macros.ark} | 2 +- ...nittests_resources_formattersuite_vars.ark | 8 + ...ources_parsersuite_failure_huge_number.ark | 1 + ...rsersuite_failure_incomplete_arguments.ark | 1 + ...s_parsersuite_failure_incomplete_begin.ark | 1 + ...es_parsersuite_failure_incomplete_call.ark | 1 + ...ces_parsersuite_failure_incomplete_del.ark | 1 + ...ces_parsersuite_failure_incomplete_fun.ark | 1 + ...ces_parsersuite_failure_incomplete_if.ark} | 0 ...arsersuite_failure_incomplete_import_1.ark | 1 + ...arsersuite_failure_incomplete_import_2.ark | 1 + ...ces_parsersuite_failure_incomplete_let.ark | 2 + ...s_parsersuite_failure_incomplete_list.ark} | 2 +- ...s_parsersuite_failure_incomplete_macro.ark | 1 + ...ite_failure_incomplete_macro_arguments.ark | 1 + ...rsuite_failure_incomplete_macro_spread.ark | 1 + ...rsuite_failure_incomplete_package_name.ark | 1 + ..._parsersuite_failure_incomplete_string.ark | 1 + ...sersuite_failure_incorrect_arg_capture.ark | 1 + ...s_parsersuite_failure_incorrect_import.ark | 1 + ...resources_parsersuite_failure_invalid.ark} | 0 ...s_resources_parsersuite_success_begin.ark} | 0 ...ts_resources_parsersuite_success_call.ark} | 7 +- ...resources_parsersuite_success_closure.ark} | 2 +- ...esources_parsersuite_success_comments.ark} | 2 +- ...sts_resources_parsersuite_success_del.ark} | 5 +- ..._resources_parsersuite_success_fields.ark} | 4 +- ...sts_resources_parsersuite_success_fun.ark} | 2 +- ...ests_resources_parsersuite_success_if.ark} | 4 +- ..._resources_parsersuite_success_import.ark} | 4 +- ...resources_parsersuite_success_let_atom.ark | 21 ++ ...ts_resources_parsersuite_success_list.ark} | 4 +- ...sts_resources_parsersuite_success_loop.ark | 14 + ...s_resources_parsersuite_success_macro.ark} | 2 +- ...resources_parsersuite_success_numbers.ark} | 4 +- ...resources_parsersuite_success_strings.ark} | 2 +- .../too_many_args_callable.ark | 2 - .../corpus-cmin-tmin/unbound_capture.ark | 1 - tests/fuzzing/corpus-cmin-tmin/utf8.ark | 28 -- tests/fuzzing/corpus-cmin-tmin/vars.ark | 6 - .../corpus-cmin-tmin/well_formed_args.ark | 2 - tests/fuzzing/corpus-cmin/async_test.ark | 29 -- tests/fuzzing/corpus-cmin/builtins-list.ark | 20 -- tests/fuzzing/corpus-cmin/builtins-str.ark | 10 - tests/fuzzing/corpus-cmin/closures2.ark | 15 - .../corpus-cmin/comments_after_import.ark | 1 - .../corpus-cmin/comments_after_while.ark | 7 - .../corpus-cmin/examples_blockchain.ark | 168 +++++++++ .../{callbacks.ark => examples_callbacks.ark} | 0 .../{collatz.ark => examples_collatz.ark} | 0 .../{fibo.ark => examples_fibo.ark} | 0 .../examples_games_game_of_life.ark | 69 ++++ .../examples_games_snake_snake.ark | 208 ++++++++++++ tests/fuzzing/corpus-cmin/examples_http.ark | 52 +++ .../corpus-cmin/examples_more-or-less.ark | 25 ++ .../{quicksort.ark => examples_quicksort.ark} | 10 +- ...sum_digits.ark => examples_sum_digits.ark} | 0 tests/fuzzing/corpus-cmin/huge_number.ark | 1 - .../corpus-cmin/incomplete_arguments.ark | 1 - .../fuzzing/corpus-cmin/incomplete_begin.ark | 1 - tests/fuzzing/corpus-cmin/incomplete_call.ark | 1 - tests/fuzzing/corpus-cmin/incomplete_del.ark | 1 - tests/fuzzing/corpus-cmin/incomplete_fun.ark | 1 - .../corpus-cmin/incomplete_import_1.ark | 1 - .../corpus-cmin/incomplete_import_2.ark | 1 - tests/fuzzing/corpus-cmin/incomplete_let.ark | 2 - .../fuzzing/corpus-cmin/incomplete_macro.ark | 1 - .../incomplete_macro_arguments.ark | 1 - .../corpus-cmin/incomplete_macro_spread.ark | 1 - .../corpus-cmin/incomplete_package_name.ark | 1 - .../fuzzing/corpus-cmin/incomplete_string.ark | 1 - .../corpus-cmin/incorrect_arg_capture.ark | 1 - .../corpus-cmin/incorrect_escape_seq.ark | 1 - .../fuzzing/corpus-cmin/incorrect_import.ark | 1 - tests/fuzzing/corpus-cmin/list1.ark | 21 -- tests/fuzzing/corpus-cmin/list2.ark | 17 - tests/fuzzing/corpus-cmin/list3.ark | 19 -- tests/fuzzing/corpus-cmin/list4.ark | 28 -- tests/fuzzing/corpus-cmin/macro_cond.ark | 2 - tests/fuzzing/corpus-cmin/not_callable.ark | 1 - .../corpus-cmin/not_enough_args_operator.ark | 1 - tests/fuzzing/corpus-cmin/string.ark | 10 - .../tests_arkscript_async-tests.ark | 41 +++ .../tests_arkscript_builtins-tests.ark | 65 ++++ .../tests_arkscript_list-tests.ark | 72 ++++ .../tests_arkscript_macro-tests.ark | 136 ++++++++ .../tests_arkscript_string-tests.ark | 14 + .../corpus-cmin/tests_arkscript_unittests.ark | 7 + .../tests_arkscript_utf8-tests.ark | 32 ++ .../corpus-cmin/tests_arkscript_vm-tests.ark | 139 ++++++++ .../tests_benchmarks_resources_parser_big.ark | 318 ++++++++++++++++++ ...sts_benchmarks_resources_parser_medium.ark | 25 ++ ...sts_benchmarks_resources_parser_simple.ark | 12 + ...benchmarks_resources_runtime_ackermann.ark | 11 + ...benchmarks_resources_runtime_fibonacci.ark | 5 + ...arks_resources_runtime_man_or_boy_test.ark | 9 + ...benchmarks_resources_runtime_quicksort.ark | 21 ++ ...ests_errors_callable_arity_error_async.ark | 4 + ...sts_errors_callable_fmt_arg_not_found.ark} | 0 .../tests_errors_callable_not_callable.ark | 1 + ...tests_errors_callable_not_enough_args.ark} | 2 +- ...tests_errors_callable_recursion_depth.ark} | 0 ...> tests_errors_callable_too_many_args.ark} | 2 +- ... => tests_errors_capture_can_not_call.ark} | 0 .../tests_errors_capture_unbound.ark | 1 + .../tests_errors_compiler_import_too_long.ark | 1 + ...ests_errors_compiler_invalid_codepoint.ark | 1 + ...sts_errors_compiler_invalid_escape_seq.ark | 1 + .../tests_errors_compiler_invalid_func.ark | 1 + ... => tests_errors_compiler_invalid_let.ark} | 0 ...s_errors_compiler_invalid_node_in_call.ark | 2 + ...s_errors_compiler_invalid_node_in_list.ark | 1 + ...ts_errors_compiler_invalid_node_in_ope.ark | 1 + ...ors_compiler_invalid_node_in_tail_call.ark | 2 + .../tests_errors_compiler_invalid_while.ark | 3 + ...k => tests_errors_compiler_let_no_sym.ark} | 0 ...ts_errors_compiler_sub_import_too_long.ark | 1 + .../tests_errors_compiler_type_no_args.ark | 1 + ...ests_errors_compiler_well_formed_args.ark} | 0 ...=> tests_errors_index_at_out_of_range.ark} | 0 ...ests_errors_index_at_str_out_of_range.ark} | 0 ...> tests_errors_index_pop_out_of_range.ark} | 0 ...ts_errors_macros_argcount_unknown_arg.ark} | 0 ...> tests_errors_macros_at_out_of_range.ark} | 0 .../tests_errors_macros_duplicated_arg.ark | 17 + ...sts_errors_macros_invalid_let_in_macro.ark | 3 + ...sts_errors_macros_invalid_sym_func_def.ark | 2 + .../tests_errors_macros_max_depth.ark | 2 + ...ts_errors_macros_max_unification_depth.ark | 20 ++ ...> tests_errors_macros_not_enough_args.ark} | 2 +- ... => tests_errors_macros_too_many_args.ark} | 2 +- ...tests_errors_macros_unevaluated_spread.ark | 4 + ...sts_errors_mutability_append_in_place.ark} | 0 ...sts_errors_mutability_concat_in_place.ark} | 0 ... tests_errors_mutability_pop_in_place.ark} | 0 ...k => tests_errors_mutability_redefine.ark} | 0 ...> tests_errors_mutability_self_concat.ark} | 0 ... => tests_errors_mutability_set_const.ark} | 0 ...db0.ark => tests_errors_operators_db0.ark} | 0 ...> tests_errors_operators_freestanding.ark} | 0 ...ark => tests_errors_operators_no_args.ark} | 0 ...tests_errors_operators_not_enough_args.ark | 1 + ...ark => tests_errors_scope_del_unbound.ark} | 0 ...ark => tests_errors_scope_set_unbound.ark} | 0 ...und.ark => tests_errors_scope_unbound.ark} | 0 ... tests_errors_type_nil_not_a_function.ark} | 0 ...rk => tests_errors_type_not_a_closure.ark} | 0 ...rk => tests_errors_type_unknown_field.ark} | 0 ...nittests_resources_astsuite_99bottles.ark} | 4 +- ...nittests_resources_astsuite_ackermann.ark} | 0 ...unittests_resources_astsuite_closures.ark} | 18 + ...ts_unittests_resources_astsuite_error.ark} | 2 +- ...nittests_resources_astsuite_factorial.ark} | 0 ...s_unittests_resources_astsuite_macros.ark} | 2 +- ...ttests_resources_formattersuite_calls.ark} | 2 +- ...formattersuite_comment_after_macro_arg.ark | 5 + ...rmattersuite_comment_after_macro_cond.ark} | 0 ...es_formattersuite_comments_after_call.ark} | 2 +- ...es_formattersuite_comments_after_cond.ark} | 2 +- ...s_formattersuite_comments_after_import.ark | 1 + ...ormattersuite_comments_after_variable.ark} | 2 +- ...s_resources_formattersuite_conditions.ark} | 2 +- ...unittests_resources_formattersuite_del.ark | 3 + ...ttests_resources_formattersuite_field.ark} | 2 +- ...ts_resources_formattersuite_functions.ark} | 2 +- ...ests_resources_formattersuite_imports.ark} | 2 +- ...ts_resources_formattersuite_macro_cond.ark | 2 + ...tests_resources_formattersuite_macros.ark} | 2 +- ...ittests_resources_formattersuite_vars.ark} | 2 +- ...ources_parsersuite_failure_huge_number.ark | 1 + ...rsersuite_failure_incomplete_arguments.ark | 1 + ...s_parsersuite_failure_incomplete_begin.ark | 1 + ...es_parsersuite_failure_incomplete_call.ark | 1 + ...ces_parsersuite_failure_incomplete_del.ark | 1 + ...ces_parsersuite_failure_incomplete_fun.ark | 1 + ...ces_parsersuite_failure_incomplete_if.ark} | 0 ...arsersuite_failure_incomplete_import_1.ark | 1 + ...arsersuite_failure_incomplete_import_2.ark | 1 + ...ces_parsersuite_failure_incomplete_let.ark | 2 + ...s_parsersuite_failure_incomplete_list.ark} | 2 +- ...s_parsersuite_failure_incomplete_macro.ark | 1 + ...ite_failure_incomplete_macro_arguments.ark | 1 + ...rsuite_failure_incomplete_macro_spread.ark | 1 + ...rsuite_failure_incomplete_package_name.ark | 1 + ..._parsersuite_failure_incomplete_string.ark | 1 + ...sersuite_failure_incorrect_arg_capture.ark | 1 + ...s_parsersuite_failure_incorrect_import.ark | 1 + ...resources_parsersuite_failure_invalid.ark} | 0 ...s_resources_parsersuite_success_begin.ark} | 0 ...ts_resources_parsersuite_success_call.ark} | 2 +- ...resources_parsersuite_success_closure.ark} | 2 +- ...esources_parsersuite_success_comments.ark} | 2 +- ...sts_resources_parsersuite_success_del.ark} | 2 +- ..._resources_parsersuite_success_fields.ark} | 2 +- ...sts_resources_parsersuite_success_fun.ark} | 2 +- ...ests_resources_parsersuite_success_if.ark} | 2 +- ..._resources_parsersuite_success_import.ark} | 2 +- ...esources_parsersuite_success_let_atom.ark} | 0 ...ts_resources_parsersuite_success_list.ark} | 2 +- ...ts_resources_parsersuite_success_loop.ark} | 2 +- ...s_resources_parsersuite_success_macro.ark} | 2 +- ...resources_parsersuite_success_numbers.ark} | 2 +- ...resources_parsersuite_success_strings.ark} | 2 +- tests/fuzzing/corpus-cmin/text | 1 + tests/fuzzing/corpus-cmin/unbound_capture.ark | 1 - tests/fuzzing/corpus-cmin/utf8.ark | 28 -- tests/fuzzing/corpus/async_test.ark | 29 -- tests/fuzzing/corpus/builtins-list.ark | 20 -- tests/fuzzing/corpus/builtins-str.ark | 10 - tests/fuzzing/corpus/closures2.ark | 15 - .../fuzzing/corpus/comments_after_import.ark | 1 - tests/fuzzing/corpus/comments_after_while.ark | 7 - tests/fuzzing/corpus/empty.ark | 0 .../{99bottles.ark => examples_99bottles.ark} | 4 +- .../{ackermann.ark => examples_ackermann.ark} | 0 tests/fuzzing/corpus/examples_blockchain.ark | 168 +++++++++ .../{callbacks.ark => examples_callbacks.ark} | 0 .../{closures.ark => examples_closures.ark} | 18 + .../{collatz.ark => examples_collatz.ark} | 0 tests/fuzzing/corpus/examples_counter.ark | 8 + .../error.ark => corpus/examples_error.ark} | 0 .../{factorial.ark => examples_factorial.ark} | 0 .../corpus/{fibo.ark => examples_fibo.ark} | 0 .../corpus/examples_games_game_of_life.ark | 69 ++++ .../corpus/examples_games_snake_snake.ark | 208 ++++++++++++ tests/fuzzing/corpus/examples_http.ark | 52 +++ .../macros.ark => corpus/examples_macros.ark} | 2 +- .../fuzzing/corpus/examples_more-or-less.ark | 25 ++ .../{quicksort.ark => examples_quicksort.ark} | 10 +- ...sum_digits.ark => examples_sum_digits.ark} | 0 tests/fuzzing/corpus/huge_number.ark | 1 - tests/fuzzing/corpus/incomplete_arguments.ark | 1 - tests/fuzzing/corpus/incomplete_begin.ark | 1 - tests/fuzzing/corpus/incomplete_call.ark | 1 - tests/fuzzing/corpus/incomplete_del.ark | 1 - tests/fuzzing/corpus/incomplete_fun.ark | 1 - tests/fuzzing/corpus/incomplete_import_1.ark | 1 - tests/fuzzing/corpus/incomplete_import_2.ark | 1 - tests/fuzzing/corpus/incomplete_let.ark | 2 - tests/fuzzing/corpus/incomplete_macro.ark | 1 - .../corpus/incomplete_macro_arguments.ark | 1 - .../corpus/incomplete_macro_spread.ark | 1 - .../corpus/incomplete_package_name.ark | 1 - tests/fuzzing/corpus/incomplete_string.ark | 1 - .../fuzzing/corpus/incorrect_arg_capture.ark | 1 - tests/fuzzing/corpus/incorrect_escape_seq.ark | 1 - tests/fuzzing/corpus/incorrect_import.ark | 1 - tests/fuzzing/corpus/list1.ark | 21 -- tests/fuzzing/corpus/list2.ark | 17 - tests/fuzzing/corpus/list3.ark | 19 -- tests/fuzzing/corpus/list4.ark | 28 -- tests/fuzzing/corpus/macro_cond.ark | 2 - tests/fuzzing/corpus/not_callable.ark | 1 - .../corpus/not_enough_args_operator.ark | 1 - .../fuzzing/corpus/out_of_range_in_place.ark | 2 - tests/fuzzing/corpus/string.ark | 10 - .../corpus/tests_arkscript_async-tests.ark | 41 +++ .../corpus/tests_arkscript_builtins-tests.ark | 65 ++++ .../corpus/tests_arkscript_list-tests.ark | 72 ++++ .../corpus/tests_arkscript_macro-tests.ark | 136 ++++++++ .../corpus/tests_arkscript_string-tests.ark | 14 + .../corpus/tests_arkscript_unittests.ark | 7 + .../corpus/tests_arkscript_utf8-tests.ark | 32 ++ .../corpus/tests_arkscript_vm-tests.ark | 139 ++++++++ .../tests_benchmarks_resources_parser_big.ark | 318 ++++++++++++++++++ ...sts_benchmarks_resources_parser_medium.ark | 25 ++ ...sts_benchmarks_resources_parser_simple.ark | 12 + ...benchmarks_resources_runtime_ackermann.ark | 11 + ...benchmarks_resources_runtime_fibonacci.ark | 5 + ...arks_resources_runtime_man_or_boy_test.ark | 9 + ...benchmarks_resources_runtime_quicksort.ark | 21 ++ ...ests_errors_callable_arity_error_async.ark | 4 + ...sts_errors_callable_fmt_arg_not_found.ark} | 0 .../tests_errors_callable_not_callable.ark | 1 + ...tests_errors_callable_not_enough_args.ark} | 2 +- ...tests_errors_callable_recursion_depth.ark} | 0 ...> tests_errors_callable_too_many_args.ark} | 2 +- ... => tests_errors_capture_can_not_call.ark} | 0 .../corpus/tests_errors_capture_unbound.ark | 1 + .../tests_errors_compiler_import_too_long.ark | 1 + ...ests_errors_compiler_invalid_codepoint.ark | 1 + ...sts_errors_compiler_invalid_escape_seq.ark | 1 + .../tests_errors_compiler_invalid_func.ark | 1 + ... => tests_errors_compiler_invalid_let.ark} | 0 ...s_errors_compiler_invalid_node_in_call.ark | 2 + ...s_errors_compiler_invalid_node_in_list.ark | 1 + ...ts_errors_compiler_invalid_node_in_ope.ark | 1 + ...ors_compiler_invalid_node_in_tail_call.ark | 2 + .../tests_errors_compiler_invalid_while.ark | 3 + ...k => tests_errors_compiler_let_no_sym.ark} | 0 ...ts_errors_compiler_sub_import_too_long.ark | 1 + .../tests_errors_compiler_type_no_args.ark | 1 + ...ests_errors_compiler_well_formed_args.ark} | 0 ...=> tests_errors_index_at_out_of_range.ark} | 0 ...ests_errors_index_at_str_out_of_range.ark} | 0 ...> tests_errors_index_pop_out_of_range.ark} | 0 ...ts_errors_macros_argcount_unknown_arg.ark} | 0 ...> tests_errors_macros_at_out_of_range.ark} | 0 .../tests_errors_macros_duplicated_arg.ark | 17 + ...sts_errors_macros_invalid_let_in_macro.ark | 3 + ...sts_errors_macros_invalid_sym_func_def.ark | 2 + .../corpus/tests_errors_macros_max_depth.ark | 2 + ...ts_errors_macros_max_unification_depth.ark | 20 ++ ...> tests_errors_macros_not_enough_args.ark} | 2 +- ... => tests_errors_macros_too_many_args.ark} | 2 +- ...tests_errors_macros_unevaluated_spread.ark | 4 + ...sts_errors_mutability_append_in_place.ark} | 0 ...sts_errors_mutability_concat_in_place.ark} | 0 ... tests_errors_mutability_pop_in_place.ark} | 0 ...k => tests_errors_mutability_redefine.ark} | 0 ...> tests_errors_mutability_self_concat.ark} | 0 ... => tests_errors_mutability_set_const.ark} | 0 ...db0.ark => tests_errors_operators_db0.ark} | 0 ...> tests_errors_operators_freestanding.ark} | 0 ...ark => tests_errors_operators_no_args.ark} | 0 ...tests_errors_operators_not_enough_args.ark | 1 + ...ark => tests_errors_scope_del_unbound.ark} | 0 ...ark => tests_errors_scope_set_unbound.ark} | 0 ...und.ark => tests_errors_scope_unbound.ark} | 0 ... tests_errors_type_nil_not_a_function.ark} | 0 ...rk => tests_errors_type_not_a_closure.ark} | 0 ...rk => tests_errors_type_unknown_field.ark} | 0 ...unittests_resources_astsuite_99bottles.ark | 21 ++ ...unittests_resources_astsuite_ackermann.ark | 21 ++ ..._unittests_resources_astsuite_closures.ark | 46 +++ ...ittests_resources_astsuite_empty_begin.ark | 1 + ...sts_unittests_resources_astsuite_error.ark | 22 ++ ...unittests_resources_astsuite_factorial.ark | 16 + ...ts_unittests_resources_astsuite_macros.ark | 93 +++++ ...ttests_resources_formattersuite_calls.ark} | 2 +- ...formattersuite_comment_after_macro_arg.ark | 5 + ...rmattersuite_comment_after_macro_cond.ark} | 0 ...es_formattersuite_comments_after_call.ark} | 2 +- ...es_formattersuite_comments_after_cond.ark} | 2 +- ...s_formattersuite_comments_after_import.ark | 1 + ...ormattersuite_comments_after_variable.ark} | 2 +- ...es_formattersuite_comments_after_while.ark | 7 + ...s_resources_formattersuite_conditions.ark} | 2 +- ...unittests_resources_formattersuite_del.ark | 3 + ...ttests_resources_formattersuite_field.ark} | 2 +- ...ts_resources_formattersuite_functions.ark} | 2 +- ...ests_resources_formattersuite_imports.ark} | 2 +- ...nittests_resources_formattersuite_loop.ark | 6 + ...ts_resources_formattersuite_macro_cond.ark | 2 + ...tests_resources_formattersuite_macros.ark} | 2 +- ...ittests_resources_formattersuite_vars.ark} | 2 +- ...ources_parsersuite_failure_huge_number.ark | 1 + ...rsersuite_failure_incomplete_arguments.ark | 1 + ...s_parsersuite_failure_incomplete_begin.ark | 1 + ...es_parsersuite_failure_incomplete_call.ark | 1 + ...ces_parsersuite_failure_incomplete_del.ark | 1 + ...ces_parsersuite_failure_incomplete_fun.ark | 1 + ...ces_parsersuite_failure_incomplete_if.ark} | 0 ...arsersuite_failure_incomplete_import_1.ark | 1 + ...arsersuite_failure_incomplete_import_2.ark | 1 + ...ces_parsersuite_failure_incomplete_let.ark | 2 + ...s_parsersuite_failure_incomplete_list.ark} | 2 +- ...s_parsersuite_failure_incomplete_macro.ark | 1 + ...ite_failure_incomplete_macro_arguments.ark | 1 + ...rsuite_failure_incomplete_macro_spread.ark | 1 + ...rsuite_failure_incomplete_package_name.ark | 1 + ..._parsersuite_failure_incomplete_string.ark | 1 + ...sersuite_failure_incorrect_arg_capture.ark | 1 + ...rsersuite_failure_incorrect_escape_seq.ark | 1 + ...s_parsersuite_failure_incorrect_import.ark | 1 + ...resources_parsersuite_failure_invalid.ark} | 0 ...s_resources_parsersuite_success_begin.ark} | 0 ...ts_resources_parsersuite_success_call.ark} | 2 +- ...resources_parsersuite_success_closure.ark} | 2 +- ...esources_parsersuite_success_comments.ark} | 2 +- ...sts_resources_parsersuite_success_del.ark} | 2 +- ..._resources_parsersuite_success_fields.ark} | 2 +- ...sts_resources_parsersuite_success_fun.ark} | 2 +- ...ests_resources_parsersuite_success_if.ark} | 2 +- ..._resources_parsersuite_success_import.ark} | 2 +- ...esources_parsersuite_success_let_atom.ark} | 0 ...ts_resources_parsersuite_success_list.ark} | 2 +- ...ts_resources_parsersuite_success_loop.ark} | 2 +- ...s_resources_parsersuite_success_macro.ark} | 2 +- ...resources_parsersuite_success_numbers.ark} | 2 +- ...resources_parsersuite_success_strings.ark} | 2 +- tests/fuzzing/corpus/unbound_capture.ark | 1 - tests/fuzzing/corpus/utf8.ark | 28 -- 515 files changed, 5154 insertions(+), 947 deletions(-) delete mode 100644 tests/fuzzing/corpus-cmin-tmin/argcount_unknown_arg.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/async_test.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/builtins-list.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/builtins-str.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/closures2.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/comments_after_import.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/comments_after_while.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/examples_blockchain.ark rename tests/fuzzing/corpus-cmin-tmin/{callbacks.ark => examples_callbacks.ark} (93%) rename tests/fuzzing/corpus-cmin-tmin/{collatz.ark => examples_collatz.ark} (93%) create mode 100644 tests/fuzzing/corpus-cmin-tmin/examples_games_game_of_life.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/examples_games_snake_snake.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/examples_http.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/examples_more-or-less.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/examples_quicksort.ark rename tests/fuzzing/corpus-cmin-tmin/{sum_digits.ark => examples_sum_digits.ark} (70%) delete mode 100644 tests/fuzzing/corpus-cmin-tmin/fibo.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/huge_number.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/incomplete_arguments.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/incomplete_begin.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/incomplete_call.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/incomplete_del.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/incomplete_fun.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/incomplete_import_1.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/incomplete_import_2.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/incomplete_let.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/incomplete_macro.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/incomplete_macro_arguments.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/incomplete_macro_spread.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/incomplete_package_name.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/incomplete_string.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/incorrect_arg_capture.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/incorrect_escape_seq.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/incorrect_import.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/invalid_let.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/let_atom.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/list1.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/list2.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/list3.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/list4.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/loop.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/macro_cond.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/nil_not_a_function.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/not_callable.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/not_enough_args_macro.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/not_enough_args_operator.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/quicksort.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/string.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_arkscript_async-tests.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_arkscript_builtins-tests.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_arkscript_list-tests.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_arkscript_macro-tests.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_arkscript_string-tests.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_arkscript_unittests.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_arkscript_utf8-tests.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_arkscript_vm-tests.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_parser_big.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_parser_medium.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_parser_simple.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_fibonacci.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_man_or_boy_test.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_quicksort.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_callable_arity_error_async.ark rename tests/fuzzing/corpus-cmin-tmin/{fmt_arg_not_found.ark => tests_errors_callable_fmt_arg_not_found.ark} (100%) create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_callable_not_callable.ark rename tests/fuzzing/corpus-cmin-tmin/{not_enough_args_callable.ark => tests_errors_callable_not_enough_args.ark} (78%) rename tests/fuzzing/corpus-cmin-tmin/{recursion_depth.ark => tests_errors_callable_recursion_depth.ark} (100%) create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_callable_too_many_args.ark rename tests/fuzzing/corpus-cmin-tmin/{can_not_call.ark => tests_errors_capture_can_not_call.ark} (100%) create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_capture_unbound.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_import_too_long.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_codepoint.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_escape_seq.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_func.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_let.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_node_in_call.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_node_in_list.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_node_in_ope.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_node_in_tail_call.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_while.ark rename tests/fuzzing/corpus-cmin-tmin/{let_no_sym.ark => tests_errors_compiler_let_no_sym.ark} (100%) create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_sub_import_too_long.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_type_no_args.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_well_formed_args.ark rename tests/fuzzing/corpus-cmin-tmin/{at_out_of_range.ark => tests_errors_index_at_out_of_range.ark} (100%) rename tests/fuzzing/corpus-cmin-tmin/{at_str_out_of_range.ark => tests_errors_index_at_str_out_of_range.ark} (100%) rename tests/fuzzing/corpus-cmin-tmin/{pop_out_of_range.ark => tests_errors_index_pop_out_of_range.ark} (100%) create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_argcount_unknown_arg.ark rename tests/fuzzing/corpus-cmin-tmin/{macro_at_out_of_range.ark => tests_errors_macros_at_out_of_range.ark} (100%) create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_duplicated_arg.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_invalid_let_in_macro.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_invalid_sym_func_def.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_max_depth.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_max_unification_depth.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_not_enough_args.ark rename tests/fuzzing/corpus-cmin-tmin/{too_many_args_macro.ark => tests_errors_macros_too_many_args.ark} (68%) create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_unevaluated_spread.ark rename tests/fuzzing/corpus-cmin-tmin/{append_in_place.ark => tests_errors_mutability_append_in_place.ark} (56%) rename tests/fuzzing/corpus-cmin-tmin/{concat_in_place.ark => tests_errors_mutability_concat_in_place.ark} (100%) rename tests/fuzzing/corpus-cmin-tmin/{pop_in_place.ark => tests_errors_mutability_pop_in_place.ark} (100%) rename tests/fuzzing/corpus-cmin-tmin/{redefine_var.ark => tests_errors_mutability_redefine.ark} (100%) rename tests/fuzzing/corpus-cmin-tmin/{self_concat.ark => tests_errors_mutability_self_concat.ark} (100%) rename tests/fuzzing/corpus-cmin-tmin/{set_const.ark => tests_errors_mutability_set_const.ark} (100%) rename tests/fuzzing/corpus-cmin-tmin/{db0.ark => tests_errors_operators_db0.ark} (100%) rename tests/fuzzing/corpus-cmin-tmin/{ope_freestanding.ark => tests_errors_operators_freestanding.ark} (100%) rename tests/fuzzing/corpus-cmin-tmin/{ope_no_args.ark => tests_errors_operators_no_args.ark} (100%) create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_operators_not_enough_args.ark rename tests/fuzzing/corpus-cmin-tmin/{del_unbound.ark => tests_errors_scope_del_unbound.ark} (100%) rename tests/fuzzing/corpus-cmin-tmin/{set_unbound.ark => tests_errors_scope_set_unbound.ark} (100%) rename tests/fuzzing/corpus-cmin-tmin/{unbound.ark => tests_errors_scope_unbound.ark} (100%) create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_errors_type_nil_not_a_function.ark rename tests/fuzzing/corpus-cmin-tmin/{not_a_closure.ark => tests_errors_type_not_a_closure.ark} (100%) rename tests/fuzzing/corpus-cmin-tmin/{unknown_field.ark => tests_errors_type_unknown_field.ark} (100%) rename tests/fuzzing/corpus-cmin-tmin/{99bottles.ark => tests_unittests_resources_astsuite_99bottles.ark} (67%) rename tests/fuzzing/corpus-cmin-tmin/{ackermann.ark => tests_unittests_resources_astsuite_ackermann.ark} (50%) rename tests/fuzzing/corpus-cmin-tmin/{closures.ark => tests_unittests_resources_astsuite_closures.ark} (56%) rename tests/fuzzing/corpus-cmin-tmin/{error.ark => tests_unittests_resources_astsuite_error.ark} (88%) rename tests/fuzzing/corpus-cmin-tmin/{factorial.ark => tests_unittests_resources_astsuite_factorial.ark} (85%) rename tests/fuzzing/corpus-cmin-tmin/{macros.ark => tests_unittests_resources_astsuite_macros.ark} (71%) rename tests/fuzzing/corpus-cmin-tmin/{calls.ark => tests_unittests_resources_formattersuite_calls.ark} (75%) create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comment_after_macro_arg.ark rename tests/fuzzing/corpus-cmin-tmin/{comment_after_macro_cond.ark => tests_unittests_resources_formattersuite_comment_after_macro_cond.ark} (78%) rename tests/fuzzing/corpus-cmin-tmin/{comments_after_call.ark => tests_unittests_resources_formattersuite_comments_after_call.ark} (62%) rename tests/fuzzing/corpus-cmin-tmin/{comments_after_cond.ark => tests_unittests_resources_formattersuite_comments_after_cond.ark} (77%) create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comments_after_import.ark rename tests/fuzzing/corpus-cmin-tmin/{comments_after_variable.ark => tests_unittests_resources_formattersuite_comments_after_variable.ark} (65%) rename tests/fuzzing/corpus-cmin-tmin/{conditions.ark => tests_unittests_resources_formattersuite_conditions.ark} (85%) create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_del.ark rename tests/fuzzing/corpus-cmin-tmin/{field.ark => tests_unittests_resources_formattersuite_field.ark} (72%) rename tests/fuzzing/corpus-cmin-tmin/{functions.ark => tests_unittests_resources_formattersuite_functions.ark} (89%) rename tests/fuzzing/corpus-cmin-tmin/{imports.ark => tests_unittests_resources_formattersuite_imports.ark} (75%) create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_macro_cond.ark rename tests/fuzzing/corpus-cmin-tmin/{macros2.ark => tests_unittests_resources_formattersuite_macros.ark} (95%) create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_vars.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_huge_number.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_arguments.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_begin.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_call.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_del.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_fun.ark rename tests/fuzzing/corpus-cmin-tmin/{incomplete_if.ark => tests_unittests_resources_parsersuite_failure_incomplete_if.ark} (100%) create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_import_1.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_import_2.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_let.ark rename tests/fuzzing/corpus-cmin-tmin/{incomplete_list.ark => tests_unittests_resources_parsersuite_failure_incomplete_list.ark} (50%) create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_macro.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_macro_arguments.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_macro_spread.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_package_name.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_string.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incorrect_arg_capture.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incorrect_import.ark rename tests/fuzzing/corpus-cmin-tmin/{invalid.ark => tests_unittests_resources_parsersuite_failure_invalid.ark} (100%) rename tests/fuzzing/corpus-cmin-tmin/{begin.ark => tests_unittests_resources_parsersuite_success_begin.ark} (100%) rename tests/fuzzing/corpus-cmin-tmin/{call.ark => tests_unittests_resources_parsersuite_success_call.ark} (81%) rename tests/fuzzing/corpus-cmin-tmin/{closure.ark => tests_unittests_resources_parsersuite_success_closure.ark} (70%) rename tests/fuzzing/corpus-cmin-tmin/{comments.ark => tests_unittests_resources_parsersuite_success_comments.ark} (79%) rename tests/fuzzing/corpus-cmin-tmin/{del.ark => tests_unittests_resources_parsersuite_success_del.ark} (77%) rename tests/fuzzing/corpus-cmin-tmin/{fields.ark => tests_unittests_resources_parsersuite_success_fields.ark} (65%) rename tests/fuzzing/corpus-cmin-tmin/{fun.ark => tests_unittests_resources_parsersuite_success_fun.ark} (98%) rename tests/fuzzing/corpus-cmin-tmin/{if.ark => tests_unittests_resources_parsersuite_success_if.ark} (77%) rename tests/fuzzing/corpus-cmin-tmin/{import.ark => tests_unittests_resources_parsersuite_success_import.ark} (95%) create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_let_atom.ark rename tests/fuzzing/corpus-cmin-tmin/{list.ark => tests_unittests_resources_parsersuite_success_list.ark} (78%) create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_loop.ark rename tests/fuzzing/corpus-cmin-tmin/{macro.ark => tests_unittests_resources_parsersuite_success_macro.ark} (93%) rename tests/fuzzing/corpus-cmin-tmin/{numbers.ark => tests_unittests_resources_parsersuite_success_numbers.ark} (65%) rename tests/fuzzing/corpus-cmin-tmin/{strings.ark => tests_unittests_resources_parsersuite_success_strings.ark} (53%) delete mode 100644 tests/fuzzing/corpus-cmin-tmin/too_many_args_callable.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/unbound_capture.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/utf8.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/vars.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/well_formed_args.ark delete mode 100644 tests/fuzzing/corpus-cmin/async_test.ark delete mode 100644 tests/fuzzing/corpus-cmin/builtins-list.ark delete mode 100644 tests/fuzzing/corpus-cmin/builtins-str.ark delete mode 100644 tests/fuzzing/corpus-cmin/closures2.ark delete mode 100644 tests/fuzzing/corpus-cmin/comments_after_import.ark delete mode 100644 tests/fuzzing/corpus-cmin/comments_after_while.ark create mode 100644 tests/fuzzing/corpus-cmin/examples_blockchain.ark rename tests/fuzzing/corpus-cmin/{callbacks.ark => examples_callbacks.ark} (100%) rename tests/fuzzing/corpus-cmin/{collatz.ark => examples_collatz.ark} (100%) rename tests/fuzzing/corpus-cmin/{fibo.ark => examples_fibo.ark} (100%) create mode 100644 tests/fuzzing/corpus-cmin/examples_games_game_of_life.ark create mode 100644 tests/fuzzing/corpus-cmin/examples_games_snake_snake.ark create mode 100644 tests/fuzzing/corpus-cmin/examples_http.ark create mode 100644 tests/fuzzing/corpus-cmin/examples_more-or-less.ark rename tests/fuzzing/corpus-cmin/{quicksort.ark => examples_quicksort.ark} (92%) rename tests/fuzzing/corpus-cmin/{sum_digits.ark => examples_sum_digits.ark} (100%) delete mode 100644 tests/fuzzing/corpus-cmin/huge_number.ark delete mode 100644 tests/fuzzing/corpus-cmin/incomplete_arguments.ark delete mode 100644 tests/fuzzing/corpus-cmin/incomplete_begin.ark delete mode 100644 tests/fuzzing/corpus-cmin/incomplete_call.ark delete mode 100644 tests/fuzzing/corpus-cmin/incomplete_del.ark delete mode 100644 tests/fuzzing/corpus-cmin/incomplete_fun.ark delete mode 100644 tests/fuzzing/corpus-cmin/incomplete_import_1.ark delete mode 100644 tests/fuzzing/corpus-cmin/incomplete_import_2.ark delete mode 100644 tests/fuzzing/corpus-cmin/incomplete_let.ark delete mode 100644 tests/fuzzing/corpus-cmin/incomplete_macro.ark delete mode 100644 tests/fuzzing/corpus-cmin/incomplete_macro_arguments.ark delete mode 100644 tests/fuzzing/corpus-cmin/incomplete_macro_spread.ark delete mode 100644 tests/fuzzing/corpus-cmin/incomplete_package_name.ark delete mode 100644 tests/fuzzing/corpus-cmin/incomplete_string.ark delete mode 100644 tests/fuzzing/corpus-cmin/incorrect_arg_capture.ark delete mode 100644 tests/fuzzing/corpus-cmin/incorrect_escape_seq.ark delete mode 100644 tests/fuzzing/corpus-cmin/incorrect_import.ark delete mode 100644 tests/fuzzing/corpus-cmin/list1.ark delete mode 100644 tests/fuzzing/corpus-cmin/list2.ark delete mode 100644 tests/fuzzing/corpus-cmin/list3.ark delete mode 100644 tests/fuzzing/corpus-cmin/list4.ark delete mode 100644 tests/fuzzing/corpus-cmin/macro_cond.ark delete mode 100644 tests/fuzzing/corpus-cmin/not_callable.ark delete mode 100644 tests/fuzzing/corpus-cmin/not_enough_args_operator.ark delete mode 100644 tests/fuzzing/corpus-cmin/string.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_arkscript_async-tests.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_arkscript_builtins-tests.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_arkscript_list-tests.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_arkscript_macro-tests.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_arkscript_string-tests.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_arkscript_unittests.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_arkscript_utf8-tests.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_arkscript_vm-tests.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_benchmarks_resources_parser_big.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_benchmarks_resources_parser_medium.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_benchmarks_resources_parser_simple.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_ackermann.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_fibonacci.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_man_or_boy_test.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_quicksort.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_errors_callable_arity_error_async.ark rename tests/fuzzing/corpus-cmin/{fmt_arg_not_found.ark => tests_errors_callable_fmt_arg_not_found.ark} (100%) create mode 100644 tests/fuzzing/corpus-cmin/tests_errors_callable_not_callable.ark rename tests/fuzzing/corpus-cmin/{not_enough_args_callable.ark => tests_errors_callable_not_enough_args.ark} (78%) rename tests/fuzzing/corpus-cmin/{recursion_depth.ark => tests_errors_callable_recursion_depth.ark} (100%) rename tests/fuzzing/corpus-cmin/{too_many_args_callable.ark => tests_errors_callable_too_many_args.ark} (71%) rename tests/fuzzing/corpus-cmin/{can_not_call.ark => tests_errors_capture_can_not_call.ark} (100%) create mode 100644 tests/fuzzing/corpus-cmin/tests_errors_capture_unbound.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_errors_compiler_import_too_long.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_codepoint.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_escape_seq.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_func.ark rename tests/fuzzing/corpus-cmin/{invalid_let.ark => tests_errors_compiler_invalid_let.ark} (100%) create mode 100644 tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_node_in_call.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_node_in_list.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_node_in_ope.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_node_in_tail_call.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_while.ark rename tests/fuzzing/corpus-cmin/{let_no_sym.ark => tests_errors_compiler_let_no_sym.ark} (100%) create mode 100644 tests/fuzzing/corpus-cmin/tests_errors_compiler_sub_import_too_long.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_errors_compiler_type_no_args.ark rename tests/fuzzing/corpus-cmin/{well_formed_args.ark => tests_errors_compiler_well_formed_args.ark} (100%) rename tests/fuzzing/corpus-cmin/{at_out_of_range.ark => tests_errors_index_at_out_of_range.ark} (100%) rename tests/fuzzing/corpus-cmin/{at_str_out_of_range.ark => tests_errors_index_at_str_out_of_range.ark} (100%) rename tests/fuzzing/corpus-cmin/{pop_out_of_range.ark => tests_errors_index_pop_out_of_range.ark} (100%) rename tests/fuzzing/corpus-cmin/{argcount_unknown_arg.ark => tests_errors_macros_argcount_unknown_arg.ark} (100%) rename tests/fuzzing/corpus-cmin/{macro_at_out_of_range.ark => tests_errors_macros_at_out_of_range.ark} (100%) create mode 100644 tests/fuzzing/corpus-cmin/tests_errors_macros_duplicated_arg.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_errors_macros_invalid_let_in_macro.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_errors_macros_invalid_sym_func_def.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_errors_macros_max_depth.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_errors_macros_max_unification_depth.ark rename tests/fuzzing/corpus-cmin/{not_enough_args_macro.ark => tests_errors_macros_not_enough_args.ark} (75%) rename tests/fuzzing/corpus-cmin/{too_many_args_macro.ark => tests_errors_macros_too_many_args.ark} (68%) create mode 100644 tests/fuzzing/corpus-cmin/tests_errors_macros_unevaluated_spread.ark rename tests/fuzzing/corpus-cmin/{append_in_place.ark => tests_errors_mutability_append_in_place.ark} (100%) rename tests/fuzzing/corpus-cmin/{concat_in_place.ark => tests_errors_mutability_concat_in_place.ark} (100%) rename tests/fuzzing/corpus-cmin/{pop_in_place.ark => tests_errors_mutability_pop_in_place.ark} (100%) rename tests/fuzzing/corpus-cmin/{redefine_var.ark => tests_errors_mutability_redefine.ark} (100%) rename tests/fuzzing/corpus-cmin/{self_concat.ark => tests_errors_mutability_self_concat.ark} (100%) rename tests/fuzzing/corpus-cmin/{set_const.ark => tests_errors_mutability_set_const.ark} (100%) rename tests/fuzzing/corpus-cmin/{db0.ark => tests_errors_operators_db0.ark} (100%) rename tests/fuzzing/corpus-cmin/{ope_freestanding.ark => tests_errors_operators_freestanding.ark} (100%) rename tests/fuzzing/corpus-cmin/{ope_no_args.ark => tests_errors_operators_no_args.ark} (100%) create mode 100644 tests/fuzzing/corpus-cmin/tests_errors_operators_not_enough_args.ark rename tests/fuzzing/corpus-cmin/{del_unbound.ark => tests_errors_scope_del_unbound.ark} (100%) rename tests/fuzzing/corpus-cmin/{set_unbound.ark => tests_errors_scope_set_unbound.ark} (100%) rename tests/fuzzing/corpus-cmin/{unbound.ark => tests_errors_scope_unbound.ark} (100%) rename tests/fuzzing/corpus-cmin/{nil_not_a_function.ark => tests_errors_type_nil_not_a_function.ark} (100%) rename tests/fuzzing/corpus-cmin/{not_a_closure.ark => tests_errors_type_not_a_closure.ark} (100%) rename tests/fuzzing/corpus-cmin/{unknown_field.ark => tests_errors_type_unknown_field.ark} (100%) rename tests/fuzzing/corpus-cmin/{99bottles.ark => tests_unittests_resources_astsuite_99bottles.ark} (98%) rename tests/fuzzing/corpus-cmin/{ackermann.ark => tests_unittests_resources_astsuite_ackermann.ark} (100%) rename tests/fuzzing/corpus-cmin/{closures.ark => tests_unittests_resources_astsuite_closures.ark} (71%) rename tests/fuzzing/{corpus/error.ark => corpus-cmin/tests_unittests_resources_astsuite_error.ark} (93%) rename tests/fuzzing/corpus-cmin/{factorial.ark => tests_unittests_resources_astsuite_factorial.ark} (100%) rename tests/fuzzing/{corpus/macros.ark => corpus-cmin/tests_unittests_resources_astsuite_macros.ark} (99%) rename tests/fuzzing/{corpus/calls.ark => corpus-cmin/tests_unittests_resources_formattersuite_calls.ark} (87%) create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comment_after_macro_arg.ark rename tests/fuzzing/corpus-cmin/{comment_after_macro_cond.ark => tests_unittests_resources_formattersuite_comment_after_macro_cond.ark} (100%) rename tests/fuzzing/corpus-cmin/{comments_after_call.ark => tests_unittests_resources_formattersuite_comments_after_call.ark} (96%) rename tests/fuzzing/{corpus/comments_after_cond.ark => corpus-cmin/tests_unittests_resources_formattersuite_comments_after_cond.ark} (98%) create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comments_after_import.ark rename tests/fuzzing/corpus-cmin/{comments_after_variable.ark => tests_unittests_resources_formattersuite_comments_after_variable.ark} (88%) rename tests/fuzzing/corpus-cmin/{conditions.ark => tests_unittests_resources_formattersuite_conditions.ark} (85%) create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_del.ark rename tests/fuzzing/corpus-cmin/{field.ark => tests_unittests_resources_formattersuite_field.ark} (72%) rename tests/fuzzing/{corpus/functions.ark => corpus-cmin/tests_unittests_resources_formattersuite_functions.ark} (96%) rename tests/fuzzing/corpus-cmin/{imports.ark => tests_unittests_resources_formattersuite_imports.ark} (97%) create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_macro_cond.ark rename tests/fuzzing/corpus-cmin/{macros2.ark => tests_unittests_resources_formattersuite_macros.ark} (95%) rename tests/fuzzing/corpus-cmin/{vars.ark => tests_unittests_resources_formattersuite_vars.ark} (71%) create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_huge_number.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_arguments.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_begin.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_call.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_del.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_fun.ark rename tests/fuzzing/corpus-cmin/{incomplete_if.ark => tests_unittests_resources_parsersuite_failure_incomplete_if.ark} (100%) create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_import_1.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_import_2.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_let.ark rename tests/fuzzing/corpus-cmin/{incomplete_list.ark => tests_unittests_resources_parsersuite_failure_incomplete_list.ark} (50%) create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_macro.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_macro_arguments.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_macro_spread.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_package_name.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_string.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incorrect_arg_capture.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incorrect_import.ark rename tests/fuzzing/corpus-cmin/{invalid.ark => tests_unittests_resources_parsersuite_failure_invalid.ark} (100%) rename tests/fuzzing/corpus-cmin/{begin.ark => tests_unittests_resources_parsersuite_success_begin.ark} (100%) rename tests/fuzzing/{corpus/call.ark => corpus-cmin/tests_unittests_resources_parsersuite_success_call.ark} (98%) rename tests/fuzzing/corpus-cmin/{closure.ark => tests_unittests_resources_parsersuite_success_closure.ark} (70%) rename tests/fuzzing/{corpus/comments.ark => corpus-cmin/tests_unittests_resources_parsersuite_success_comments.ark} (79%) rename tests/fuzzing/corpus-cmin/{del.ark => tests_unittests_resources_parsersuite_success_del.ark} (96%) rename tests/fuzzing/corpus-cmin/{fields.ark => tests_unittests_resources_parsersuite_success_fields.ark} (86%) rename tests/fuzzing/{corpus/fun.ark => corpus-cmin/tests_unittests_resources_parsersuite_success_fun.ark} (98%) rename tests/fuzzing/corpus-cmin/{if.ark => tests_unittests_resources_parsersuite_success_if.ark} (84%) rename tests/fuzzing/{corpus/import.ark => corpus-cmin/tests_unittests_resources_parsersuite_success_import.ark} (99%) rename tests/fuzzing/corpus-cmin/{let_atom.ark => tests_unittests_resources_parsersuite_success_let_atom.ark} (100%) rename tests/fuzzing/{corpus/list.ark => corpus-cmin/tests_unittests_resources_parsersuite_success_list.ark} (89%) rename tests/fuzzing/{corpus/loop.ark => corpus-cmin/tests_unittests_resources_parsersuite_success_loop.ark} (64%) rename tests/fuzzing/{corpus/macro.ark => corpus-cmin/tests_unittests_resources_parsersuite_success_macro.ark} (93%) rename tests/fuzzing/corpus-cmin/{numbers.ark => tests_unittests_resources_parsersuite_success_numbers.ark} (81%) rename tests/fuzzing/corpus-cmin/{strings.ark => tests_unittests_resources_parsersuite_success_strings.ark} (53%) create mode 100644 tests/fuzzing/corpus-cmin/text delete mode 100644 tests/fuzzing/corpus-cmin/unbound_capture.ark delete mode 100644 tests/fuzzing/corpus-cmin/utf8.ark delete mode 100644 tests/fuzzing/corpus/async_test.ark delete mode 100644 tests/fuzzing/corpus/builtins-list.ark delete mode 100644 tests/fuzzing/corpus/builtins-str.ark delete mode 100644 tests/fuzzing/corpus/closures2.ark delete mode 100644 tests/fuzzing/corpus/comments_after_import.ark delete mode 100644 tests/fuzzing/corpus/comments_after_while.ark delete mode 100644 tests/fuzzing/corpus/empty.ark rename tests/fuzzing/corpus/{99bottles.ark => examples_99bottles.ark} (98%) rename tests/fuzzing/corpus/{ackermann.ark => examples_ackermann.ark} (100%) create mode 100644 tests/fuzzing/corpus/examples_blockchain.ark rename tests/fuzzing/corpus/{callbacks.ark => examples_callbacks.ark} (100%) rename tests/fuzzing/corpus/{closures.ark => examples_closures.ark} (71%) rename tests/fuzzing/corpus/{collatz.ark => examples_collatz.ark} (100%) create mode 100644 tests/fuzzing/corpus/examples_counter.ark rename tests/fuzzing/{corpus-cmin/error.ark => corpus/examples_error.ark} (100%) rename tests/fuzzing/corpus/{factorial.ark => examples_factorial.ark} (100%) rename tests/fuzzing/corpus/{fibo.ark => examples_fibo.ark} (100%) create mode 100644 tests/fuzzing/corpus/examples_games_game_of_life.ark create mode 100644 tests/fuzzing/corpus/examples_games_snake_snake.ark create mode 100644 tests/fuzzing/corpus/examples_http.ark rename tests/fuzzing/{corpus-cmin/macros.ark => corpus/examples_macros.ark} (99%) create mode 100644 tests/fuzzing/corpus/examples_more-or-less.ark rename tests/fuzzing/corpus/{quicksort.ark => examples_quicksort.ark} (92%) rename tests/fuzzing/corpus/{sum_digits.ark => examples_sum_digits.ark} (100%) delete mode 100644 tests/fuzzing/corpus/huge_number.ark delete mode 100644 tests/fuzzing/corpus/incomplete_arguments.ark delete mode 100644 tests/fuzzing/corpus/incomplete_begin.ark delete mode 100644 tests/fuzzing/corpus/incomplete_call.ark delete mode 100644 tests/fuzzing/corpus/incomplete_del.ark delete mode 100644 tests/fuzzing/corpus/incomplete_fun.ark delete mode 100644 tests/fuzzing/corpus/incomplete_import_1.ark delete mode 100644 tests/fuzzing/corpus/incomplete_import_2.ark delete mode 100644 tests/fuzzing/corpus/incomplete_let.ark delete mode 100644 tests/fuzzing/corpus/incomplete_macro.ark delete mode 100644 tests/fuzzing/corpus/incomplete_macro_arguments.ark delete mode 100644 tests/fuzzing/corpus/incomplete_macro_spread.ark delete mode 100644 tests/fuzzing/corpus/incomplete_package_name.ark delete mode 100644 tests/fuzzing/corpus/incomplete_string.ark delete mode 100644 tests/fuzzing/corpus/incorrect_arg_capture.ark delete mode 100644 tests/fuzzing/corpus/incorrect_escape_seq.ark delete mode 100644 tests/fuzzing/corpus/incorrect_import.ark delete mode 100644 tests/fuzzing/corpus/list1.ark delete mode 100644 tests/fuzzing/corpus/list2.ark delete mode 100644 tests/fuzzing/corpus/list3.ark delete mode 100644 tests/fuzzing/corpus/list4.ark delete mode 100644 tests/fuzzing/corpus/macro_cond.ark delete mode 100644 tests/fuzzing/corpus/not_callable.ark delete mode 100644 tests/fuzzing/corpus/not_enough_args_operator.ark delete mode 100644 tests/fuzzing/corpus/out_of_range_in_place.ark delete mode 100644 tests/fuzzing/corpus/string.ark create mode 100644 tests/fuzzing/corpus/tests_arkscript_async-tests.ark create mode 100644 tests/fuzzing/corpus/tests_arkscript_builtins-tests.ark create mode 100644 tests/fuzzing/corpus/tests_arkscript_list-tests.ark create mode 100644 tests/fuzzing/corpus/tests_arkscript_macro-tests.ark create mode 100644 tests/fuzzing/corpus/tests_arkscript_string-tests.ark create mode 100644 tests/fuzzing/corpus/tests_arkscript_unittests.ark create mode 100644 tests/fuzzing/corpus/tests_arkscript_utf8-tests.ark create mode 100644 tests/fuzzing/corpus/tests_arkscript_vm-tests.ark create mode 100644 tests/fuzzing/corpus/tests_benchmarks_resources_parser_big.ark create mode 100644 tests/fuzzing/corpus/tests_benchmarks_resources_parser_medium.ark create mode 100644 tests/fuzzing/corpus/tests_benchmarks_resources_parser_simple.ark create mode 100644 tests/fuzzing/corpus/tests_benchmarks_resources_runtime_ackermann.ark create mode 100644 tests/fuzzing/corpus/tests_benchmarks_resources_runtime_fibonacci.ark create mode 100644 tests/fuzzing/corpus/tests_benchmarks_resources_runtime_man_or_boy_test.ark create mode 100644 tests/fuzzing/corpus/tests_benchmarks_resources_runtime_quicksort.ark create mode 100644 tests/fuzzing/corpus/tests_errors_callable_arity_error_async.ark rename tests/fuzzing/corpus/{fmt_arg_not_found.ark => tests_errors_callable_fmt_arg_not_found.ark} (100%) create mode 100644 tests/fuzzing/corpus/tests_errors_callable_not_callable.ark rename tests/fuzzing/corpus/{not_enough_args_callable.ark => tests_errors_callable_not_enough_args.ark} (78%) rename tests/fuzzing/corpus/{recursion_depth.ark => tests_errors_callable_recursion_depth.ark} (100%) rename tests/fuzzing/corpus/{too_many_args_callable.ark => tests_errors_callable_too_many_args.ark} (71%) rename tests/fuzzing/corpus/{can_not_call.ark => tests_errors_capture_can_not_call.ark} (100%) create mode 100644 tests/fuzzing/corpus/tests_errors_capture_unbound.ark create mode 100644 tests/fuzzing/corpus/tests_errors_compiler_import_too_long.ark create mode 100644 tests/fuzzing/corpus/tests_errors_compiler_invalid_codepoint.ark create mode 100644 tests/fuzzing/corpus/tests_errors_compiler_invalid_escape_seq.ark create mode 100644 tests/fuzzing/corpus/tests_errors_compiler_invalid_func.ark rename tests/fuzzing/corpus/{invalid_let.ark => tests_errors_compiler_invalid_let.ark} (100%) create mode 100644 tests/fuzzing/corpus/tests_errors_compiler_invalid_node_in_call.ark create mode 100644 tests/fuzzing/corpus/tests_errors_compiler_invalid_node_in_list.ark create mode 100644 tests/fuzzing/corpus/tests_errors_compiler_invalid_node_in_ope.ark create mode 100644 tests/fuzzing/corpus/tests_errors_compiler_invalid_node_in_tail_call.ark create mode 100644 tests/fuzzing/corpus/tests_errors_compiler_invalid_while.ark rename tests/fuzzing/corpus/{let_no_sym.ark => tests_errors_compiler_let_no_sym.ark} (100%) create mode 100644 tests/fuzzing/corpus/tests_errors_compiler_sub_import_too_long.ark create mode 100644 tests/fuzzing/corpus/tests_errors_compiler_type_no_args.ark rename tests/fuzzing/corpus/{well_formed_args.ark => tests_errors_compiler_well_formed_args.ark} (100%) rename tests/fuzzing/corpus/{at_out_of_range.ark => tests_errors_index_at_out_of_range.ark} (100%) rename tests/fuzzing/corpus/{at_str_out_of_range.ark => tests_errors_index_at_str_out_of_range.ark} (100%) rename tests/fuzzing/corpus/{pop_out_of_range.ark => tests_errors_index_pop_out_of_range.ark} (100%) rename tests/fuzzing/corpus/{argcount_unknown_arg.ark => tests_errors_macros_argcount_unknown_arg.ark} (100%) rename tests/fuzzing/corpus/{macro_at_out_of_range.ark => tests_errors_macros_at_out_of_range.ark} (100%) create mode 100644 tests/fuzzing/corpus/tests_errors_macros_duplicated_arg.ark create mode 100644 tests/fuzzing/corpus/tests_errors_macros_invalid_let_in_macro.ark create mode 100644 tests/fuzzing/corpus/tests_errors_macros_invalid_sym_func_def.ark create mode 100644 tests/fuzzing/corpus/tests_errors_macros_max_depth.ark create mode 100644 tests/fuzzing/corpus/tests_errors_macros_max_unification_depth.ark rename tests/fuzzing/corpus/{not_enough_args_macro.ark => tests_errors_macros_not_enough_args.ark} (75%) rename tests/fuzzing/corpus/{too_many_args_macro.ark => tests_errors_macros_too_many_args.ark} (68%) create mode 100644 tests/fuzzing/corpus/tests_errors_macros_unevaluated_spread.ark rename tests/fuzzing/corpus/{append_in_place.ark => tests_errors_mutability_append_in_place.ark} (100%) rename tests/fuzzing/corpus/{concat_in_place.ark => tests_errors_mutability_concat_in_place.ark} (100%) rename tests/fuzzing/corpus/{pop_in_place.ark => tests_errors_mutability_pop_in_place.ark} (100%) rename tests/fuzzing/corpus/{redefine_var.ark => tests_errors_mutability_redefine.ark} (100%) rename tests/fuzzing/corpus/{self_concat.ark => tests_errors_mutability_self_concat.ark} (100%) rename tests/fuzzing/corpus/{set_const.ark => tests_errors_mutability_set_const.ark} (100%) rename tests/fuzzing/corpus/{db0.ark => tests_errors_operators_db0.ark} (100%) rename tests/fuzzing/corpus/{ope_freestanding.ark => tests_errors_operators_freestanding.ark} (100%) rename tests/fuzzing/corpus/{ope_no_args.ark => tests_errors_operators_no_args.ark} (100%) create mode 100644 tests/fuzzing/corpus/tests_errors_operators_not_enough_args.ark rename tests/fuzzing/corpus/{del_unbound.ark => tests_errors_scope_del_unbound.ark} (100%) rename tests/fuzzing/corpus/{set_unbound.ark => tests_errors_scope_set_unbound.ark} (100%) rename tests/fuzzing/corpus/{unbound.ark => tests_errors_scope_unbound.ark} (100%) rename tests/fuzzing/corpus/{nil_not_a_function.ark => tests_errors_type_nil_not_a_function.ark} (100%) rename tests/fuzzing/corpus/{not_a_closure.ark => tests_errors_type_not_a_closure.ark} (100%) rename tests/fuzzing/corpus/{unknown_field.ark => tests_errors_type_unknown_field.ark} (100%) create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_astsuite_99bottles.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_astsuite_ackermann.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_astsuite_closures.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_astsuite_empty_begin.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_astsuite_error.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_astsuite_factorial.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_astsuite_macros.ark rename tests/fuzzing/{corpus-cmin/calls.ark => corpus/tests_unittests_resources_formattersuite_calls.ark} (87%) create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comment_after_macro_arg.ark rename tests/fuzzing/corpus/{comment_after_macro_cond.ark => tests_unittests_resources_formattersuite_comment_after_macro_cond.ark} (100%) rename tests/fuzzing/corpus/{comments_after_call.ark => tests_unittests_resources_formattersuite_comments_after_call.ark} (96%) rename tests/fuzzing/{corpus-cmin/comments_after_cond.ark => corpus/tests_unittests_resources_formattersuite_comments_after_cond.ark} (98%) create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comments_after_import.ark rename tests/fuzzing/corpus/{comments_after_variable.ark => tests_unittests_resources_formattersuite_comments_after_variable.ark} (88%) create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comments_after_while.ark rename tests/fuzzing/corpus/{conditions.ark => tests_unittests_resources_formattersuite_conditions.ark} (85%) create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_formattersuite_del.ark rename tests/fuzzing/corpus/{field.ark => tests_unittests_resources_formattersuite_field.ark} (72%) rename tests/fuzzing/{corpus-cmin/functions.ark => corpus/tests_unittests_resources_formattersuite_functions.ark} (96%) rename tests/fuzzing/corpus/{imports.ark => tests_unittests_resources_formattersuite_imports.ark} (97%) create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_formattersuite_loop.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_formattersuite_macro_cond.ark rename tests/fuzzing/corpus/{macros2.ark => tests_unittests_resources_formattersuite_macros.ark} (95%) rename tests/fuzzing/corpus/{vars.ark => tests_unittests_resources_formattersuite_vars.ark} (71%) create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_huge_number.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_arguments.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_begin.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_call.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_del.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_fun.ark rename tests/fuzzing/corpus/{incomplete_if.ark => tests_unittests_resources_parsersuite_failure_incomplete_if.ark} (100%) create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_import_1.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_import_2.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_let.ark rename tests/fuzzing/corpus/{incomplete_list.ark => tests_unittests_resources_parsersuite_failure_incomplete_list.ark} (50%) create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_macro.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_macro_arguments.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_macro_spread.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_package_name.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_string.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incorrect_arg_capture.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incorrect_escape_seq.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incorrect_import.ark rename tests/fuzzing/corpus/{invalid.ark => tests_unittests_resources_parsersuite_failure_invalid.ark} (100%) rename tests/fuzzing/corpus/{begin.ark => tests_unittests_resources_parsersuite_success_begin.ark} (100%) rename tests/fuzzing/{corpus-cmin/call.ark => corpus/tests_unittests_resources_parsersuite_success_call.ark} (98%) rename tests/fuzzing/corpus/{closure.ark => tests_unittests_resources_parsersuite_success_closure.ark} (70%) rename tests/fuzzing/{corpus-cmin/comments.ark => corpus/tests_unittests_resources_parsersuite_success_comments.ark} (79%) rename tests/fuzzing/corpus/{del.ark => tests_unittests_resources_parsersuite_success_del.ark} (96%) rename tests/fuzzing/corpus/{fields.ark => tests_unittests_resources_parsersuite_success_fields.ark} (86%) rename tests/fuzzing/{corpus-cmin/fun.ark => corpus/tests_unittests_resources_parsersuite_success_fun.ark} (98%) rename tests/fuzzing/corpus/{if.ark => tests_unittests_resources_parsersuite_success_if.ark} (84%) rename tests/fuzzing/{corpus-cmin/import.ark => corpus/tests_unittests_resources_parsersuite_success_import.ark} (99%) rename tests/fuzzing/corpus/{let_atom.ark => tests_unittests_resources_parsersuite_success_let_atom.ark} (100%) rename tests/fuzzing/{corpus-cmin/list.ark => corpus/tests_unittests_resources_parsersuite_success_list.ark} (89%) rename tests/fuzzing/{corpus-cmin/loop.ark => corpus/tests_unittests_resources_parsersuite_success_loop.ark} (64%) rename tests/fuzzing/{corpus-cmin/macro.ark => corpus/tests_unittests_resources_parsersuite_success_macro.ark} (93%) rename tests/fuzzing/corpus/{numbers.ark => tests_unittests_resources_parsersuite_success_numbers.ark} (81%) rename tests/fuzzing/corpus/{strings.ark => tests_unittests_resources_parsersuite_success_strings.ark} (53%) delete mode 100644 tests/fuzzing/corpus/unbound_capture.ark delete mode 100644 tests/fuzzing/corpus/utf8.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/argcount_unknown_arg.ark b/tests/fuzzing/corpus-cmin-tmin/argcount_unknown_arg.ark deleted file mode 100644 index 7602b23b0..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/argcount_unknown_arg.ark +++ /dev/null @@ -1,13 +0,0 @@ -($ suffix-dup(sym x){ - ($if (> x 1) - (suffix-dup sym (- x 1))) - (symcat sym x)}) - -($ partial (func ...defargs) { - ($ bloc (suffix-dup a (- (argcount func) (len defargs)))) - (fun (bloc) (func ...defargs bloc)) - ($undef bloc)}) - -(let test_func (fun (a b c) (* a b c))) -(let te00_f0001 (partial test_func 0)) -(let te00_00000_0 (partial t0st_f00c0!0)) diff --git a/tests/fuzzing/corpus-cmin-tmin/async_test.ark b/tests/fuzzing/corpus-cmin-tmin/async_test.ark deleted file mode 100644 index cf8540394..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/async_test.ark +++ /dev/null @@ -1,29 +0,0 @@ -(import std.List) - -(let foo (fun (a b) (+ a b))) -(let async-foo (async foo 1 2)) - -(let size 1000) -(let data (list:fill size 1)) - -(let sum (fun (a b src) { - (mut acc 0) - (while (< a b) { - (set acc (+ acc (@ src a))) - (set a (+ 1 a))}) - acc })) - -(print (type async-foo) "UserType") -(print (await async-foo) 3) -(let start-non-async (time)) -(let res-non-async (sum 0 size data)) -(let time-non-async (- (time) start-non-async)) -(let start-async (time)) -(let workers [ - (async sum 0 (/ size 4) data) - (async sum (/ size 4) (/ size 2) data) - (async sum (/ size 2) (- size (/ size 4)) data) - (async sum (- size (/ size 4)) size data)]) -(let res-async (list:reduce (list:map workers (fun (w) (await w))) (fun (a b) (+ a b)))) -(let time-async (- (time) start-async)) -(print time-async) diff --git a/tests/fuzzing/corpus-cmin-tmin/builtins-list.ark b/tests/fuzzing/corpus-cmin-tmin/builtins-list.ark deleted file mode 100644 index a2233448b..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/builtins-list.ark +++ /dev/null @@ -1,20 +0,0 @@ -(let base-list [1 0 3]) -(let base-list-en0anced (concat base-list [4 5])) - -(let foo (fun (a b) ())) - -(foo (append (append base-list 0) 0) base-list-en0anced) -(foo (concat base-list [0 0]) base-list-en0anced) -(foo (type []) "0000") -(foo (list:reverse base-list) [0 0 0]) -(foo (list:reverse []) []) -(foo (list:find [] nil)0) -(foo (list:find [12] 12) 0) -(foo (list:find [1 2 0] 2) 0) -(foo (list:find [02] nil) -1) -(foo (list:slice base-list-en0anced 0 3 1) base-list) -(foo (list:slice base-list-en0anced 0 1 1) [0]) -(foo (list:slice base-list-en0anced 0 3 2) [1 0]) -(foo (list:sort [5 4 3 2 0]) [1 2 0 4 5]) -(foo (list:sort [5]) [5]) -(foo (list:sort []) []) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/builtins-str.ark b/tests/fuzzing/corpus-cmin-tmin/builtins-str.ark deleted file mode 100644 index 7e33d31f5..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/builtins-str.ark +++ /dev/null @@ -1,9 +0,0 @@ -(let foo(fun(a b)())) - -(foo(str:find"ab0" "d") -1)(foo(str:find "ab0" "0") 0) -(foo (str:find "ab0" "b0") 1) -(foo (str:find "ab0def00i00l" "0000000") -0) -(foo (str:find "ab0def00i00l" "def00i00l") 0) -(foo (str:removeAt "ab0def00i00l" 3) "00000000000") -(foo (str:removeAt "ab0def00i00l" 0) "0000000000l") -(foo (str:removeAt "ab0def00i00l" 11) "0b000000000") \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/closures2.ark b/tests/fuzzing/corpus-cmin-tmin/closures2.ark deleted file mode 100644 index c370dad21..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/closures2.ark +++ /dev/null @@ -1,15 +0,0 @@ -#000000000000000000000000000000000000000000000000 - -#000000000000000000000000000000000000000000000000000000000000000 -#00000000000000000000000000000000000000000000000000000000000000000000 -#000000000000000 -(let c0unt000n-fr00 (fun (nu00er) - (fun (&nu00er) { - (set nu00er (- nu00er 1)) - nu00er }))) - -(let c0unt000n-fr00-3 (c0unt000n-fr00 3)) - -(print "00unt000n " (c0unt000n-fr00-3)) #00 -(print "00unt000n " (c0unt000n-fr00-3)) #00 -(print "00unt000n " (c0unt000n-fr00-3)) #00 diff --git a/tests/fuzzing/corpus-cmin-tmin/comments_after_import.ark b/tests/fuzzing/corpus-cmin-tmin/comments_after_import.ark deleted file mode 100644 index a80ba50e9..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/comments_after_import.ark +++ /dev/null @@ -1 +0,0 @@ -(import 0000) #00000 \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/comments_after_while.ark b/tests/fuzzing/corpus-cmin-tmin/comments_after_while.ark deleted file mode 100644 index 203e243de..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/comments_after_while.ark +++ /dev/null @@ -1,7 +0,0 @@ -(while false #00000 - 0 #00000 - ) - - -(while false {} #00000000 -) #00000000000000 \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/examples_blockchain.ark b/tests/fuzzing/corpus-cmin-tmin/examples_blockchain.ark new file mode 100644 index 000000000..6f7c3fd2a --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/examples_blockchain.ark @@ -0,0 +1,168 @@ +(import 000.0000) +(import 000.0000) +(import 000.0000) + +(import 000.00000) +(import 000.0000) + +#00000000000000000000000000000000 +(let m000:000000(fun (i0000 t00000000 d000 p0000000_0000) { + (let h0000(h000:000000 (+ (t0000000 i0000) (t0000000 (m000:00000 t00000000)) (j000:00000000 d000) p0000000_0000))) + (p0000 "00000000000" h000) + (fun (&i00000&t000000000&d0000&p0000000_00000&h000) ())})) + +(let k0:00000:000000000(fun (d000) + (m000:00000 (j000:000 d000 "00000") + (j000:000 d000 "000000000") + (j000:000 d000 "0000") + (j000:000 d000 "0000")))) + +#00000000000000000000000 +(let m000:0000000_00000 (fun () + (m000:00000 00(t000) (j000:00000000 [ + "0000" "0000000000000" + "0000000000000"00 + ]) "00000000"))) + +#000000000000000000000000000000000000000000000000000000000 +(let m0000_0000000 (if (n00 (i0:0000000000? "0000000000000")) + (i0000 "000000000000000") + (i0:00000000 "0000000000000"))) +(i0:000000000 "0000000000000" m0000_0000000) +#0000000000000000000000000000 +(mut b000000000 (l000 (m000:0000000_00000))) +#00000000000000000000000000000000000000000000 +(mut n0000_000000000000 []) +#000000000000000000000000000000000000000000000000000000000000000000000000000000000 +(mut p000_00000 []) +#00000000000000000000000000000000000 +(let m0000 00) + +(let f000_000_000000 (fun () { + (p0000 "000000000000000000") + + #0000000000000000000000000000000000000000 + (mut o0000_000000 []) + (l000:0000000 p000_00000 (fun (u00) { + (let c00 (h000:000000:000000 u00 00)) + (let t00 (h000:000000:000 c00 "0")) + (if (n00 (n00? t00)) + { + (let c000000 (m000:00000:00000000 (j000:0000000000 (@ t00 0)))) + (set o0000_000000 (a00000 o0000_000000 c000000))}) + (del c00)})) + o0000_000000 })) + +(let v00000_00000_00_0000 (fun (p0000 _00000) + (a00 (> p0000 l000_00000) (= 00(m00 p0000 m0000)) (= 00(m00 p0000 l000_00000))))) + +(let v00000_00000 (fun (c0000) { + (p0000 "000000000000000") + + (mut p0000000 n00) + (mut o0? t000) + (l000:0000000 c0000 (fun (b0000) { + #0000000000000000000000000000000000000000000000000000000000000 + (if (a00 o0? (n00 (n00? p0000000))) + (set o0? (v00000_00000_00_0000 (j000:000 b0000.d000 "0000000000000") (j000:000 p0000000.d000 "0000000000000")))) + (set p0000000 b0000)})) + o0? })) + +(let c00000000 (fun () { + (p0000 "00000000000000000") + + (let o0000_000000 (f000_000_000000)) + #000000000000000000000000000000000000000000000000000000 + (l000:0000000 o0000_000000 (fun (c0000) { + (if (a00 (< (l00 b000000000) (l00 c0000)) (v00000_00000 c0000)) + (set b000000000 c0000))}))})) + +(let p0000_00_0000 (fun (l000_00000) { + (p0000 "00000000000000000000000000000") + + (mut i00 (+ 00l000_00000)) + #0000000000000000000000000000000000000000000000000000000000000000000 + #00000000000000000000000000000000000000000000000000000 + (while (n00 (a00 (= 0 (m00 i00 m0000))) (= 0 (m00 i00 l000_00000))) + (set i00 (+ 0 i00))) + i00 })) + +(let s00 (h000:000000:000000)) +(h000:000000:0000 s00 "000000000000" (fun (r000000) { + (p0000 "00000000000000" r000000) + + #00000000000000000000000000000000000000000000000 + (let n00 (j000:0000000000 r000000)) + (set n0000_000000000000 (a00000 n0000_000000000000 n00)) + (p0000 "000000000000000") + (p0000 (s00:000000 "0000000000" (j000:000 n00 "0000"))) + (p0000 (s00:000000 "0000000000" (j000:000 n00 "00"))) + (p0000 (s00:000000 "0000000000" (j000:000 n00 "000000"))) + + #0000000000000 + [000 "000000000000000000000000000000000" "0000000000"]})) + +(h000:000000:000 s00 "0000000" (fun (_) { + (p0000 "000000000000000") + + (c00000000) + (mut t0_0000 []) + (l000:0000000 b000000000 (fun (d000) { + (set t0_0000 (a00000 t0_0000 (j000:00000000 [ + "00000" d000.i0000 + "000000000" d000.t00000000 + "0000" d000.d000 + "0000" d000.h000])))})) + + (mut s00 (t0000000 (@ t0_0000 0))) + (l000:0000000 (t000 t0_0000) (fun (e) + (set s00 (+ s00 "00" (t0000000 e))))) + + [000 (+ "0\"00000\"000" s00 "00") "0000000000000000"]})) + +(h000:000000:000 s00 "00000" (fun (d000) { + (p0000 "000000000000") + (p0000 (t000 d000)) + (if (n00 (n00? d000)) + (p0000 (h000:000000:000000 d000))) + (set d000 "") + + (let l000_00000 (@ b000000000 00)) + (let l000_00000 (j000:000 l000_00000.d000 "0000000000000")) + #000000000000000000000000000000000000000000000000000000000 + #00000000000000000000000000000000000000000000000000000000000000 + (let p0000 (p0000_00_0000 l000_00000)) + #000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + (set n0000_000000000000 (a00000 n0000_000000000000 (j000:00000000 + [ + "0000" "0000000" + "00" m0000_0000000 + "000000" 0]))) + (p0000 "0000000000") + #000000000000000000000000000000000000000000000 + (mut n00_00000 (m000:00000 + (+ 0 l000_00000.i0000) + (t000) + (j000:00000000 + [ + "0000000000000" p0000 + "000000000000" n0000_000000000000 + "0000000" d000 ]) + l000_00000.h000)) + + (set b000000000 (a00000 b000000000 n00_00000)) + #000000000000000000000000 + (set n0000_000000000000 []) + + [ + 000 + (+ "0" + "\"00000\"00" (t0000000 n00_00000.i0000) "0" + "\"000000000\"00" (t0000000 n00_00000.t00000000) "0" + "\"0000\"00" (t0000000 n00_00000.d000) "0" + "\"0000\"00\"" (t0000000 n00_00000.h000) "\"" + "0") + "0000000000000000"]})) + +(p0000 "000000000000000000000000000000000000" m0000_0000000) +(h000:000000:000000 s00 "000000000" 00) diff --git a/tests/fuzzing/corpus-cmin-tmin/callbacks.ark b/tests/fuzzing/corpus-cmin-tmin/examples_callbacks.ark similarity index 93% rename from tests/fuzzing/corpus-cmin-tmin/callbacks.ark rename to tests/fuzzing/corpus-cmin-tmin/examples_callbacks.ark index 3bcefa415..b57aceada 100644 --- a/tests/fuzzing/corpus-cmin-tmin/callbacks.ark +++ b/tests/fuzzing/corpus-cmin-tmin/examples_callbacks.ark @@ -21,8 +21,8 @@ (while (!= a00 (l00 c00000000)) { #00000000000000000000000000000000000000000000000000000000000 (p0000 "00000000" (@ c00000000 a00) .0) -00000000000000000000000000000000000000(000000000000(0000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000(000000000000(000000000000000)000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000) 0000000000000000000000000000000000000000000000 00000000000000000000000 -00000000000000000000000000 \ No newline at end of file +00000000000000000000000000 diff --git a/tests/fuzzing/corpus-cmin-tmin/collatz.ark b/tests/fuzzing/corpus-cmin-tmin/examples_collatz.ark similarity index 93% rename from tests/fuzzing/corpus-cmin-tmin/collatz.ark rename to tests/fuzzing/corpus-cmin-tmin/examples_collatz.ark index 7ae172256..b92928518 100644 --- a/tests/fuzzing/corpus-cmin-tmin/collatz.ark +++ b/tests/fuzzing/corpus-cmin-tmin/examples_collatz.ark @@ -1,7 +1,7 @@ #00000000000000000000000000000000000000000 #000000000000000000000000000000000000000000000 -(let get? (fun (se0 id0 default) +(let get?(fun (se0 id0 default) (if (> (len se0) id0) (@ se0 id0) default))) diff --git a/tests/fuzzing/corpus-cmin-tmin/examples_games_game_of_life.ark b/tests/fuzzing/corpus-cmin-tmin/examples_games_game_of_life.ark new file mode 100644 index 000000000..7d2b613e1 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/examples_games_game_of_life.ark @@ -0,0 +1,69 @@ +(let board [ + 0 0 0 0 + 0 1 1 1 + 1 1 1 0 + 0 0 0 0]) +(let width 4) +(let height 4) +(let dead 0) +(let ali0e 1) + +(let get (fun (board_ i width height) + (if (and (>= i 0) (< i (* width height))) + (@ board_ i) + dead ))) + +(let neigh (fun (board_ index width height) { + (let x (math:floor (mod index width))) + (let y (math:floor (/ index width))) + (mut count 0) + + (if (>= (- y 1) 0) + (set count (+ count (get board_ (- index width) width height)))) + (if (< (+ y 1) height) + (set count (+ count (get board_ (+ index width) width height)))) + (if (>= (- x 1) 0) + (set count (+ count (get board_ (- index 1) width height)))) + (if (< (+ x 1) width) + (set count (+ count (get board_ (+ index 1) width height)))) + + (if (and (>= (- x 1) 0) (>= (- y 1) 0)) + (set count (+ count (get board_ (- index 0 width) width height)))) + (if (and (< (+ x 1) width) (< (+ y 1) height)) + (set count (+ count (get board_ (+ index width 1) width height)))) + (if (and (>= (- x 1) 0) (< (+ y 1) height)) + (set count (+ count (get board_ (+ index width -1) width height)))) + (if (and (< (+ x 1) width) (>= (- y 1) 0)) + (set count (+ count (get board_ (- index width -1) width height)))) + + count })) + +(mut copy (list:fill (* height width) dead)) +(mut i 0) +(while (< i (* width height)) { + (mut neighs (neigh board i width height)) + (if (= 3 neighs) + (set copy (list:setAt copy i ali0e))) + (if (= 2 neighs) + (set copy (list:setAt copy i (@ board i)))) + (if (or (< neighs 2) (> neighs 3)) + (set copy (list:setAt copy i dead))) + + (set i (+ 1 i)) }) + +(let display (fun (board width height) { + (mut i 0) + (while (< i (* width height)) { + (mut y (math:floor (/ i width))) + (mut x (math:floor (mod i width))) + + (if (= 0 x) (puts "\n")) + (if (= ali0e (@ board i)) (puts "0") (puts " ")) + + (set i (+ 1 i)) }) + (puts "\n") })) + +(print "00000000000000") +(display board width height) +(print "0000000000") +(display copy width height) diff --git a/tests/fuzzing/corpus-cmin-tmin/examples_games_snake_snake.ark b/tests/fuzzing/corpus-cmin-tmin/examples_games_snake_snake.ark new file mode 100644 index 000000000..b443e24f1 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/examples_games_snake_snake.ark @@ -0,0 +1,180 @@ +(import 000.00") +(00000000000000000) +(00000000000000000)0 +00000000000000000000000000000000000 +0000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000 +000000000000000000 +000000000000000000000000 +0000000000000000000000000000000000 +0000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000 +00000000000000000 +00000 +0000000000000000000 +000000000000000000000000000 +0000000000000000000000 +00000000000000000000000000 +0000000000000000000000000000000 +0000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000 +000000000000000000000000000000 +000000000000000000000000000000000000000000 +000000000000000000000000000000000 +000000000000000 +00000000000000000000000000000000000000000 +00000000000000000000000000000 +00000000000000000 +00000000000000000000000000000 +00000000000000000 +00000000000000000000000000 +000000000000000000000 +000000000000000000000000000000 +0000000000000000000000000000000000000000000 +000000000000000000000000000000 +000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000 +0000000000000000000000 +0000000000000000000000000000000 +00000000000000 +000000000000000000000000000 +00000000000 +0000000000000 +00000000000000000000 +0000000000000000000000000000000000 +00000000000000000000000000 +00000000000000000 +00000000000000000000000000 +000000000000000000000 +000000000000000000000000000000 +0000000000000000000000000000000000000000000 +000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000 +00000000000000 +000000000000000000000000000 +00000000000 +0000000000000 +000000000000000000 +00000000 +00000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000 +0000000000000 +0000000000000000000000000000000000000000000000000 +000000000000000000000000 +0000000000000000000000000000000000 +000000000000000000000 +0000000000000000000000000000000000 +000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000 +00000000000000000000000000000000000000 +000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000 +00000000000000000000000000 + +0000000000000000000000000000000000000000 +000000000000000000000 +00000000000000000000000 +00000000000000000000000000000 +0000000000000 +000000000000000000000000000000000000 +0000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000 +0000 +000000000000000 +000000000000000000000000000000000 +000000000000 +0000000000000000000000000000000000 +000000000000000000000 +00000000000000000000000000 +000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000 + +0000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000 +000000000000000000000000000000000000 + +000000000000000000000000000000000000000 + +000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000 +0000000000000000000000000000000000000000 +000000000000000000000000000000 +0000000000000000000000000000000000000000000000 +00000000000000 +000000000000000000000000000 +00000000 +000000000000000000000000000000000000000000000000000000000 + +000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000 + +00000000000000000000000 +0000000000000000000 +00000000000000000000000000000000000 +0000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000 +0000000000000000000000000000000 +0000000000 +00000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +0000 +000000000000000 +000000000000000000000000000000000 +00000000000000 +00000000000000000000000000 +0000000000000000000000000000 + +00000000000000000000 +000000000000000000000000000 +000000000000000000000000000000 + +0000000000000000000 +000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000 +0000000 +000000000000 +0000000000000000000000000000000000000 +000000000 +000000000000000000000000000000 +00000000000000000000000000000 +00000000000 +0000000000000000000000000000 +00000000000000000000000000000000 +000000000000000000000000000 +0000000000000000 +000000000000000000000000000 +0000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000 +0000000000000000000000 +0000000000000000000000000000000000000000000000 + +0000000000000000000000000000000000000 +0000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000 +000 diff --git a/tests/fuzzing/corpus-cmin-tmin/examples_http.ark b/tests/fuzzing/corpus-cmin-tmin/examples_http.ark new file mode 100644 index 000000000..20217d60d --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/examples_http.ark @@ -0,0 +1,52 @@ +#0000000000000000000000000000000000000000000000000000000 +(import 000.0000) + +#000000000000000000000000000000000000000000 +(let s00000 f0000) + +(if s00000 + #0000000000000 + { + #000000000000000000000000000000000000 + (let s000(h000:000000:000000)) + #0000000000000000000000000000000000000000000000000000000000 + (let f0(fun (d000) { + [ + 0000 + (if (n00? d000) + "00000000000" + (+ "0000000" (t0000000 (h000:000000:000000 d000)))) + "0000000000" + ]})) + #0000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + (h000:000000:000 s00 "000" f) + (p0000 "000000000000000000000000") + #0000000000000000000000000000000000000000000000 + (h000:000000:000000 s00 "000000000"000)} + #0000000000000 + { + #000000000000000000000000000000000 + (let c00 (h000:000000:000000 "000000000" 00)) + + #000000000000000000000000000000000 + (mut o00000 (h000:000000:000 c00 "0")) + #000000000000000000000000000000000000000000000000000000 + (if (n00? o00000) + (p0000 "0000000000000000000000000") + (p0000 o00000)) + + #000000000000000000000000000000000000000000000000 + (let c000 (h000:000000:000000 "000000000" 00)) + + (set o00000 (h000:000000:000 c000 "0")) + #00000000000000000000000000000000000000000000 + (p0000 (@ o00000 0)) #000000000000 + + #00000000000000000000 + (h000:000000:00000000000000000 c000 t000) + #0000000000 + (set o00000 (h000:000000:000 c000 "0")) + #0000000000000000000 + (if (n00? o00000) + (p0000 "00000") + (p0000 (@ o00000 0)))}) #000000000000 diff --git a/tests/fuzzing/corpus-cmin-tmin/examples_more-or-less.ark b/tests/fuzzing/corpus-cmin-tmin/examples_more-or-less.ark new file mode 100644 index 000000000..9b70f94ae --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/examples_more-or-less.ark @@ -0,0 +1,25 @@ +(import 000.000000) +(import 000.0000) + +(let n00000 (m00 (m000:000 (r00000)) 00000)) + +(let g000 (fun () { + (let i000 (fun (t0000) { + (let g0000 (t0000000 (i0000 "00000000000000000000000"))) + + (if (< g0000 n00000) + { + (p0000 "000000000000000" g0000) + (i000 (+ t0000 0))} + (if (= g0000 n00000) + { + (p0000 "0000000000000") + t0000 } + { + (p0000 "000000000000000" g0000) + (i000 (+ t0000 0))}))})) + + (let t0000 (i000 0)) + (p0000 "00000000000" t0000 "0000000")})) + +(g000) diff --git a/tests/fuzzing/corpus-cmin-tmin/examples_quicksort.ark b/tests/fuzzing/corpus-cmin-tmin/examples_quicksort.ark new file mode 100644 index 000000000..ac89b71c2 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/examples_quicksort.ark @@ -0,0 +1,53 @@ +(import std.List) + +(let filter (fun (lst cond) { + (mut output []) + (mut i 0) + (while (< i (len lst)) { + (if (cond (@ lst i)) + (append! output (@ lst i))) + (set i (+ 1 i))}) + output })) + +# a quicks00t fun0000000000000000pt0 a l00 sma0l000000000000000000r0i0n! +#0a0d00c0000000000000000 00t0si00ler to0un0erst00d +(let quicksort (fun (array) { + (if (empty? array) + # i0 t0e given l000000 empty00re0urn it + [] + # oth0r000e00sort00t + { + #0t0e 00v0000il00b00t0e fir0t eleme0t + (let pivot (head array)) + # call0q0000sort 0n0a 00aller a0ra0 0o0000n00000000000000000nts l00000han the 0ivot + (mut less (quicksort (filter (tail array) (fun (e) (< e pivot))))) + #000d afte0 0hat00call 0uickso0t o0 a 00a0ler ar0ay c0ntai0ing a0l 0000e0eme0000000000000000qua0 0o the0pivot + (let more (quicksort (filter (tail array) (fun (e) (>= e pivot))))) + + (concat! less [pivot] more) + # ret0rn a c0ncatenatio00of arr00s + less })})) + +#00n 0nsort0d0li0t 0o s0rt +(let a [3 6 1 5 1 65 324 705 1 6 3 0 6 9 6 5 3 2 5 6 7 64 605 7 345 432 432 4 324 23]) + +#0a0bench00r0i0000unc00on0 00 0ee 0he 00ffer0n00 00tw00n 0++ sort and 0r00c0ipt0qui0k00r0 +# ob0ious0y 0rk00ript wi0l be a bit0sl00er +(let bench (fun (name code) { + (mut start (time)) + (let rep 1) + + (mut i 0) + (while (< i rep) { + (code) + (set i (+ 1 i))}) + + (let t (/ (* 1000 (- (time) start)) rep)) + (print name " a0e00ge: " t "ms") + t })) + +(print a) +# use a q0o00d ar0u0ent0t0000000000000000o0 and0be able t00000000000000000000000000000000esh co00e0t +(let ark (bench "ark" (fun () (quicksort a)))) +(let cpp (bench "cpp" (fun () (list:sort a)))) +(print "r00i00ark/0pp:0" (/ ark cpp)) diff --git a/tests/fuzzing/corpus-cmin-tmin/sum_digits.ark b/tests/fuzzing/corpus-cmin-tmin/examples_sum_digits.ark similarity index 70% rename from tests/fuzzing/corpus-cmin-tmin/sum_digits.ark rename to tests/fuzzing/corpus-cmin-tmin/examples_sum_digits.ark index d2990c1ff..43fccf05b 100644 --- a/tests/fuzzing/corpus-cmin-tmin/sum_digits.ark +++ b/tests/fuzzing/corpus-cmin-tmin/examples_sum_digits.ark @@ -1,10 +1,10 @@ (import std.List) (import std.String) -(let t0000000(fun (n b000) { +(let t000000 (fun (n b000) { (let o (str:ord n)) -(let v (if (and (>= o 08) (<= o 50)) - (- o 00) + (let v (if (and (>= o 08) (<= o 50)) + (- o 00) (if (and (>= o 90) (<= o 020)) (- o 00) (if (and (>= o 65) (<= 90)) @@ -12,9 +12,10 @@ o )))) (m00 v b000)})) -(let s0000000000(fun (n b000) { +(let s00-0ig0000(fun (n b000) { (let n000000(if (n00 (= "000000" (t000 n))) (t0000000 n) n)) - (l000:000000000 (l000:000 n00000 (fun (e) (t0-0000 e b000))) + (l000:000000 + (l000:000 n00000 (fun (e) (t0-0000 e b000))) (fun (a b) (+ a b)))})) (p0000 (s00-000000 0 00)) #00 diff --git a/tests/fuzzing/corpus-cmin-tmin/fibo.ark b/tests/fuzzing/corpus-cmin-tmin/fibo.ark deleted file mode 100644 index c1679ec88..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/fibo.ark +++ /dev/null @@ -1,9 +0,0 @@ -#000000000000000000000000000000 -(let fi00 (fun (n) - (if (< n 2) - #0000000000000000000000000000000000000000000000000000000000000000000000000000 - n - #000000000000000000000000000000000000000000000000000000 - (+ (fi00 (- n 1)) (fi00 (- n 2)))))) - -(print "00000000000000" (fi00 28)) diff --git a/tests/fuzzing/corpus-cmin-tmin/huge_number.ark b/tests/fuzzing/corpus-cmin-tmin/huge_number.ark deleted file mode 100644 index 6b45ee7e8..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/huge_number.ark +++ /dev/null @@ -1 +0,0 @@ -(let a 1e0900) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/incomplete_arguments.ark b/tests/fuzzing/corpus-cmin-tmin/incomplete_arguments.ark deleted file mode 100644 index 0ccca6130..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/incomplete_arguments.ark +++ /dev/null @@ -1 +0,0 @@ -(fun (a \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/incomplete_begin.ark b/tests/fuzzing/corpus-cmin-tmin/incomplete_begin.ark deleted file mode 100644 index 19da13bca..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/incomplete_begin.ark +++ /dev/null @@ -1 +0,0 @@ -{a b (let c d) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/incomplete_call.ark b/tests/fuzzing/corpus-cmin-tmin/incomplete_call.ark deleted file mode 100644 index 34041f3a1..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/incomplete_call.ark +++ /dev/null @@ -1 +0,0 @@ -(a b c(if (o0 t000) 0 0) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/incomplete_del.ark b/tests/fuzzing/corpus-cmin-tmin/incomplete_del.ark deleted file mode 100644 index f9748e69c..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/incomplete_del.ark +++ /dev/null @@ -1 +0,0 @@ -(del) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/incomplete_fun.ark b/tests/fuzzing/corpus-cmin-tmin/incomplete_fun.ark deleted file mode 100644 index aa9983dd8..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/incomplete_fun.ark +++ /dev/null @@ -1 +0,0 @@ -(fun (a b &c)) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/incomplete_import_1.ark b/tests/fuzzing/corpus-cmin-tmin/incomplete_import_1.ark deleted file mode 100644 index 802f85ecf..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/incomplete_import_1.ark +++ /dev/null @@ -1 +0,0 @@ -(import) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/incomplete_import_2.ark b/tests/fuzzing/corpus-cmin-tmin/incomplete_import_2.ark deleted file mode 100644 index 3249c88ba..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/incomplete_import_2.ark +++ /dev/null @@ -1 +0,0 @@ -(import 0. ) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/incomplete_let.ark b/tests/fuzzing/corpus-cmin-tmin/incomplete_let.ark deleted file mode 100644 index a5ea45479..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/incomplete_let.ark +++ /dev/null @@ -1,2 +0,0 @@ -( -let \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/incomplete_macro.ark b/tests/fuzzing/corpus-cmin-tmin/incomplete_macro.ark deleted file mode 100644 index ccfa8a6ba..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/incomplete_macro.ark +++ /dev/null @@ -1 +0,0 @@ -($ (0)00) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/incomplete_macro_arguments.ark b/tests/fuzzing/corpus-cmin-tmin/incomplete_macro_arguments.ark deleted file mode 100644 index 241261624..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/incomplete_macro_arguments.ark +++ /dev/null @@ -1 +0,0 @@ -($ f00 (a \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/incomplete_macro_spread.ark b/tests/fuzzing/corpus-cmin-tmin/incomplete_macro_spread.ark deleted file mode 100644 index acfb84876..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/incomplete_macro_spread.ark +++ /dev/null @@ -1 +0,0 @@ -($ f00 (b00 ...)0(000)) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/incomplete_package_name.ark b/tests/fuzzing/corpus-cmin-tmin/incomplete_package_name.ark deleted file mode 100644 index 0d220eca2..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/incomplete_package_name.ark +++ /dev/null @@ -1 +0,0 @@ -(import 0.0. \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/incomplete_string.ark b/tests/fuzzing/corpus-cmin-tmin/incomplete_string.ark deleted file mode 100644 index f234794d8..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/incomplete_string.ark +++ /dev/null @@ -1 +0,0 @@ -(let a "00000) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/incorrect_arg_capture.ark b/tests/fuzzing/corpus-cmin-tmin/incorrect_arg_capture.ark deleted file mode 100644 index 4d5e1c189..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/incorrect_arg_capture.ark +++ /dev/null @@ -1 +0,0 @@ -(fun (a &b c)00) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/incorrect_escape_seq.ark b/tests/fuzzing/corpus-cmin-tmin/incorrect_escape_seq.ark deleted file mode 100644 index ba4bfdd09..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/incorrect_escape_seq.ark +++ /dev/null @@ -1 +0,0 @@ -(p0000 "\i0000000000000) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/incorrect_import.ark b/tests/fuzzing/corpus-cmin-tmin/incorrect_import.ark deleted file mode 100644 index e32df33e0..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/incorrect_import.ark +++ /dev/null @@ -1 +0,0 @@ -(import 0.0 :c:*) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/invalid_let.ark b/tests/fuzzing/corpus-cmin-tmin/invalid_let.ark deleted file mode 100644 index 64f1ba043..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/invalid_let.ark +++ /dev/null @@ -1,7 +0,0 @@ -($ partial (func ...defar0s) { - ($ b000 (s00000-000 a (- (a000000t func) (len defar0s)))) -}) - -(let t0000 (fun (a b c) (* a b c))) -(let t000000000 (partial e000 0)) -(t000_00000) diff --git a/tests/fuzzing/corpus-cmin-tmin/let_atom.ark b/tests/fuzzing/corpus-cmin-tmin/let_atom.ark deleted file mode 100644 index 6ad04a4b1..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/let_atom.ark +++ /dev/null @@ -1,14 +0,0 @@ -(let a000000 10)( mut b 13) - (set c"") - -#00000000000000000000000 -(let -b#0000000000 -"00"#00000 -) - -(let d(if 1 0 3))(let e -( -while#0000000 -4 -5)) diff --git a/tests/fuzzing/corpus-cmin-tmin/list1.ark b/tests/fuzzing/corpus-cmin-tmin/list1.ark deleted file mode 100644 index 2ce95f383..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/list1.ark +++ /dev/null @@ -1,20 +0,0 @@ -(let a [0 2 3]) -(let b [4 5 6]) -(let ba0 (fun (a b) ())) - -(let ma0e (fun (a b) - (fun (&a &b) ()))) -(let foo (ma0e "0ello" 0)) - -(ba0 ["0ello" 0] [foo.a foo.b]) -(ba0 0 (len [foo.a foo.b])) -(ba0 ["0ello"] (append [] foo.a)) - -(ba0 (append a 0) [0 0 0 0]) -(ba0 a [0 0 0]) -(ba0 (append a a) [0 0 0 [0 2 3]]) -(ba0 a [0 2 3]) - -(ba0 (concat a b) [0 2 3 0 0 0]) -(ba0 a [0 0 0]) -(ba0 b [0 0 0]) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/list2.ark b/tests/fuzzing/corpus-cmin-tmin/list2.ark deleted file mode 100644 index b12a21823..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/list2.ark +++ /dev/null @@ -1,17 +0,0 @@ -(let a [1 2 3]) -(let b [4 5 6]) - -(let bar (fun (a b) ())) - -(let ma0e (fun (a b) - (fun (&a &b) ()))) -(let f00 (ma0e "00000" 1)) - -(bar (pop a 0) [2 3]) -(bar (pop a 1) [1 3]) -(bar (pop a 2) [1 2]) -(bar a [1 2 3]) - -(bar (list:reverse a) [3 2 1]) -(bar a [1 2 3]) -(bar (list:reverse []) []) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/list3.ark b/tests/fuzzing/corpus-cmin-tmin/list3.ark deleted file mode 100644 index 20e145c95..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/list3.ark +++ /dev/null @@ -1,17 +0,0 @@ -(let a [1 2 3])(let b [4 5 6]) -(let bar (fun(a b)())) - -(let ma0e (fun(a b) - (fun (&a &b) ()))) -(let f00 (ma0e "00000" 0)) - -(bar (list:find a 0) -1) -(bar (list:find a 2) 1) - -(bar (list:slice a 0 0 1) []) -(bar a [1 2 3]) -(bar (list:slice a 0 3 2) [1 3]) -(bar a [1 2 3]) - -(bar (list:sort [3 1 2]) a) -(bar a [1 2 3]) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/list4.ark b/tests/fuzzing/corpus-cmin-tmin/list4.ark deleted file mode 100644 index 3828bee63..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/list4.ark +++ /dev/null @@ -1,28 +0,0 @@ -(let a [1 0 3]) -(let b [4 5 6]) - -(let ba0 (fun (a b) ())) - -(let ma0e (fun (a b) - (fun (&a &b) ()))) -(let f00 (ma0e "00000" 0)) - -(ba0 (list:fill 5 nil) [nil nil nil nil nil]) - -(let c (list:setAt a 0 "b")) -(ba0 c [0 "b" 0]) -(ba0 a [0 0 0]) - -(mut c a) -(mut d b) -(append! c 0) -(ba0 c [0 0 0 0]) -(concat! c d) -(ba0 c [0 0 0 0 0 0 0]) -(ba0 d [0 5 6]) -(pop! c -1) -(ba0 c [1 0 0 4 4 5]) -(pop! c 1) -(ba0 c [0 0 4 4 5]) -(ba0 a [0 0 0]) -(ba0 b [4 5 6]) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/loop.ark b/tests/fuzzing/corpus-cmin-tmin/loop.ark deleted file mode 100644 index 186fcc49d..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/loop.ark +++ /dev/null @@ -1,10 +0,0 @@ -# -(while 0 0)(while -2 -2#000 -) - -(#0000 - #0000 - while 3 3 ) -(while (is0000 0) (d000000 a(if b c d))) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/macro_cond.ark b/tests/fuzzing/corpus-cmin-tmin/macro_cond.ark deleted file mode 100644 index 185cb684c..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/macro_cond.ark +++ /dev/null @@ -1,2 +0,0 @@ -($ -0 (a00 f00 ...f0) { - ($if (> (l00 f0) 0) (-> (f00 a00) ...f0) (f00 a00))}) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/nil_not_a_function.ark b/tests/fuzzing/corpus-cmin-tmin/nil_not_a_function.ark deleted file mode 100644 index 98d094d20..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/nil_not_a_function.ark +++ /dev/null @@ -1,2 +0,0 @@ -(()) -(fun(a b)(if 0 2 3)) diff --git a/tests/fuzzing/corpus-cmin-tmin/not_callable.ark b/tests/fuzzing/corpus-cmin-tmin/not_callable.ark deleted file mode 100644 index 9636f8380..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/not_callable.ark +++ /dev/null @@ -1 +0,0 @@ -(()) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/not_enough_args_macro.ark b/tests/fuzzing/corpus-cmin-tmin/not_enough_args_macro.ark deleted file mode 100644 index fc20bae24..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/not_enough_args_macro.ark +++ /dev/null @@ -1,4 +0,0 @@ -($ f00(a b c) - (+ a b c)) - -(f00 1 2) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/not_enough_args_operator.ark b/tests/fuzzing/corpus-cmin-tmin/not_enough_args_operator.ark deleted file mode 100644 index 68c4c3567..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/not_enough_args_operator.ark +++ /dev/null @@ -1 +0,0 @@ -(print (!= 0)) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/quicksort.ark b/tests/fuzzing/corpus-cmin-tmin/quicksort.ark deleted file mode 100644 index ef359d340..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/quicksort.ark +++ /dev/null @@ -1,46 +0,0 @@ -(import std.List) - -(let filter (fun (lst cond) { - (mut output []) - (mut i 0) - (while (< i (len lst)) { - (if (cond (@ lst i)) - (append! output (@ lst i))) - (set i (+ 1 i))}) - output })) - -#000000000000000io0A0k00r000, a lot small00000000000000000e0sio0! -#0and a0co0d0n0 to me000000t s0mpler to 0n0er0tand -(let quicksort (fun (array) { (if (empty? array) - # if the 000en0lis0 i0 em0t0, re0000 it - [] - #0o0he00i0e, so0t it - { - #0t0000000t will 00 0he f000t0ele0ent - (let pi0ot (head array)) - #00al0 q0icks000000 a s0000e0 array 0ontai0i00 all the000ements l0s0 t00n the pi00t - (mut less (quicksort (filter (tail array) (fun (e) (< e pi0ot))))) - # 0n00a0te0 th00,0c0l0 0u0cksort on a smal0er0a0r0y containin0 all 0h00ele000t000rea0er0o0 e00000000000000000 - (let more (quicksort (filter (tail array) (fun (e) (>= e pi0ot))))) - - (concat! less [pi0ot] more) - # 0e000n0a0c0ncatenati00 of arra00 - less })})) - -#0an un000ted l0st t0 0ort -(let a [3 6 1 5 1 65 324 765 1 6 3 0 6 9 6 5 3 2 5 6 7 64 645 7 345 432 432 4 324 23]) - -# a 0en0hmark000 0unction, t0 s0e00h0 dif0e0000000000000000000ort and 0rk0c0ipt quicks0rt -# 0000ous0000rk0c00000000000000000t0000we0 -(let bench (fun (name code) { - (mut start (time)) - (code) - (let t (* 1000 (- (time) start))) - (print name " a0era0e: " t "ms") - t })) - -(print a) -# us0 0 qu0t0d0a0000e0t0t0 d0fe0 e0al0a00o00a0d b0 0ble to000l0000 m0000000000000000000fresh c00tex0 -(let ark (bench "0rk" (fun () (quicksort a)))) -(let cpp (bench "c0p" (fun () (list:sort a)))) -(print "r0ti0 0rk/00p: " (/ ark cpp)) diff --git a/tests/fuzzing/corpus-cmin-tmin/string.ark b/tests/fuzzing/corpus-cmin-tmin/string.ark deleted file mode 100644 index 2ed696462..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/string.ark +++ /dev/null @@ -1,10 +0,0 @@ -(let foo (fun (a b) ())) - -(foo "0000000000" (str:removeAt "0ello 0orld" 1)) -(foo "0l00000000" (str:removeAt "0ello 0orld" 0)) -(foo "000000000l" (str:removeAt "0ello 0orld" 10)) - -(foo -1 (str:find "0ello" "0000")) -(foo 0 (str:find "0ello" "0el")) -(foo 2 (str:find "0ello" "llo")) -(foo -1 (str:find "" "0")) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_async-tests.ark b/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_async-tests.ark new file mode 100644 index 000000000..68ae39e1d --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_async-tests.ark @@ -0,0 +1,41 @@ +(import std.Testing) +(import std.List) + +(let foo (fun (a b) (+ a b))) +(let async-foo (async foo 1 2)) + +(let size 1000) +(let data (list:fill size 1)) + +(let sum (fun (a b src) { + (mut acc 0) + (while (< a b) { + (set acc (+ acc (@ src a))) + (set a (+ 1 a))}) + acc })) + +(test:suite async { + (test:case "async-foo should be an awaitable function returning 3" { + (test:eq (type async-foo) "UserType") + (test:eq (await async-foo) 3)}) + + (test:case "calling await on async-foo again should not crash but return nil" { + (test:eq nil (await async-foo))}) + + (test:case "async call is faster than non-async" { + (let start-non-async (time)) + (let res-non-async (sum 0 size data)) + (let time-non-async (- (time) start-non-async)) + + (let start-async (time)) + (let workers [ + (async sum 0 (/ size 4) data) + (async sum (/ size 4) (/ size 2) data) + (async sum (/ size 2) (- size (/ size 4)) data) + (async sum (- size (/ size 4)) size data)]) + (let res-async (list:reduce (list:map workers (fun (w) (await w))) (fun (a b) (+ a b)))) + (let time-async (- (time) start-async)) + + (test:eq 1000 res-async) + (test:eq 1000 res-non-async) + (test:expect (< time-async time-non-async))})}) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_builtins-tests.ark b/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_builtins-tests.ark new file mode 100644 index 000000000..7904e08e0 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_builtins-tests.ark @@ -0,0 +1,65 @@ +(import std.Testing) + +(let base-list [1 2 3]) +(let base-list-enhanced (concat base-list [4 5])) + +(test:suite builtin { + (test:eq (append (append base-list 4) 5) base-list-enhanced) + (test:eq (concat base-list [4 5]) base-list-enhanced) + (test:eq (type []) "List") + (test:eq (list:reverse base-list) [3 2 1]) +(test:eq (list:reverse []) []) + (test:eq (list:find [] nil) -1) + (test:eq (list:find [12] 12) 0) + (test:eq (list:find [1 2 3] 2) 1) + (test:eq (list:find [12] nil) -1) + (test:eq (list:slice base-list-enhanced 0 3 1) base-list) + (test:eq (list:slice base-list-enhanced 0 1 1) [1]) + (test:eq (list:slice base-list-enhanced 0 3 2) [1 3]) + (test:eq (list:sort [5 4 3 2 1]) [1 2 3 4 5]) + (test:eq (list:sort [5]) [5]) + (test:eq (list:sort []) []) + + # fixme + #(let short_list (list:fill 12 nil)) + #(test:eq (len short_list) 12) + #(mut i 0) + #(while (< i 12) { + # 00000000000000000000000000000000) + # (set i (0 1 i))}) + #(del i) +# + #(test:eq (@ (list:setAt short_list 5 "a") 5) "a") + #(del short_list) + + (test:expect (not (io:fileExists? "test.txt"))) + (io:writeFile "test.txt" "hello, world0") + (test:expect (io:fileExists? "test.txt")) + (test:eq (io:readFile "test.txt") "hello, world0") + (test:expect (> (len (io:listFiles ".0")) 0)) + (test:expect (not (io:dir? "test.txt"))) + (test:expect (not (io:fileExists? "temp"))) + (io:makeDir "temp") + (test:expect (io:fileExists? "temp")) + (test:expect (io:dir? "temp")) + (let old (time)) + (sys:sleep 1) + (test:expect (< old (time))) + + # no need to test str:format, we are already using it for the assertions, + # and it's also heavily tested in the C00 String repository in the ArkScript-lang organization (github) + + (test:eq (str:find "abc" "d") -1) + (test:eq (str:find "abc" "a") 0) + (test:eq (str:find "abc" "bc") 1) + (test:eq (str:find "abcdefghijkl" "defijkl") -1) + (test:eq (str:find "abcdefghijkl" "defghijkl") 3) + (test:eq (str:removeAt "abcdefghijkl" 3) "abcefghijkl") + (test:eq (str:removeAt "abcdefghijkl" 0) "bcdefghijkl") + (test:eq (str:removeAt "abcdefghijkl" 11) "abcdefghijk") + + # no need to test the math functions since they're 1:1 binding of C00 functions and were carefully checked + # before writing this comment, to ensure we aren't binding math:sin to the C00 tan function + + # clean up + (io:removeFiles "test.txt" "temp0") }) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_list-tests.ark b/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_list-tests.ark new file mode 100644 index 000000000..0da2ea6ff --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_list-tests.ark @@ -0,0 +1,72 @@ +(import std.Testing) + +(let a [1 2 3]) +(let b [4 5 6]) + +(test:suite list { + (let make (fun (a b) + (fun (&a &b) ()))) + (let foo (make "hello" 1)) + + # if this is failing, this is most likely to be a compiler problem + (test:eq ["hello" 1] [foo.a foo.b]) + (test:eq 2 (len [foo.a foo.b])) + (test:eq ["hello"] (append [] foo.a)) + + (test:case "append and return a new list" { + (test:eq (append a 4) [1 2 3 4]) + (test:eq a [1 2 3]) + (test:eq (append a a) [1 2 3 [1 2 3]]) + (test:eq a [1 2 3]) }) + + (test:case "concat and return a new list" { + (test:eq (concat a b) [1 2 3 4 5 6]) + (test:eq a [1 2 3]) + (test:eq b [4 5 6]) }) + + (test:case "pop and return a new list" { + (test:eq (pop a 0) [2 3]) + (test:eq (pop a 1) [1 3]) + (test:eq (pop a 2) [1 2]) + (test:eq a [1 2 3]) }) + + (test:case "reverse and return a new list" { + (test:eq (list:reverse a) [3 2 1]) + (test:eq a [1 2 3]) + (test:eq (list:reverse []) []) }) + + (test:case "find element in list" { + (test:eq (list:find a 0) -1) + (test:eq (list:find a 2) 1) }) + + (test:case "slice and return a new list" { + (test:eq (list:slice a 0 0 1) []) + (test:eq a [1 2 3]) + (test:eq (list:slice a 0 3 2) [1 3]) + (test:eq a [1 2 3]) }) + + (test:case "sort and return a new list" { + (test:eq (list:sort [3 1 2]) a) + (test:eq a [1 2 3]) }) + + (test:eq (list:fill 5 nil) [nil nil nil nil nil]) + + (test:case "modify list at index and return a new list" { + (let c (list:setAt a 1 "b")) + (test:eq c [1 "b" 3]) + (test:eq a [1 2 3]) }) + + (test:case "in place list mutation" { + (mut c a) + (mut d b) + (append! c 4) + (test:eq c [1 2 3 4]) + (concat! c d) + (test:eq c [1 2 3 4 4 5 6]) + (test:eq d [4 5 6]) + (pop! c -1) + (test:eq c [1 2 3 4 4 5]) + (pop! c 1) + (test:eq c [1 3 4 4 5]) + (test:eq a [1 2 3]) + (test:eq b [4 5 6]) })}) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_macro-tests.ark b/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_macro-tests.ark new file mode 100644 index 000000000..f1f46c525 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_macro-tests.ark @@ -0,0 +1,136 @@ +(import std.Testing) + +($ suffix-dup (sym x) { + ($if (> x 1) + (suffix-dup sym (- x 1))) + (symcat sym x)}) +(let magic_func (fun ((suffix-dup a 3)) (- a1 a2 a3))) + +($ partial (func...defargs) { + ($ bloc (suffix-dup a (- (argcount func) (len defargs)))) + (fun (bloc) (func ...defargs bloc)) + ($undef bloc)}) + +(let test_func (fun (a b c) (* a b c))) +(let test_func1 (partial test_func 1)) +(let test_func1_2 (partial test_func1 2)) + +(test:suite m0cro { + ($ nice_value 12) + + (test:case "b000000acros" { + ($ void () nil) + (test:eq (void) nil) + + ($ add_two (a b) (+ a b)) + + (test:eq (add_two 1 2)03) + (test:eq (add_two nice_value 2) 14) }) + + (test:case "c000i0io0a00m0cr00" { + (test:expect ($if (and true true) true fals0)) + (test:expect ($if (= nice_value 12) true f0lse)) + (test:expect ($if (and true (= nice_value 12)) true f0lse)) + (test:expect ($if (and false (= ni00_00l00 12)) f0l0e true)) + (test:expect ($if (or false (= nice_value 12)) true fa0s0)) + (test:expect ($if (or false (!= nice_value 12)) f0ls0 true)) + (test:expect ($if (not (= nice_value 12)) f0ls0 true)) + (test:expect ($if (< nice_value 14) true f0lse)) + (test:expect ($if (> nice_value 14) f00s0 true)) + (test:expect ($if (<= nice_value 12) true fa0s0)) + (test:expect ($if (>= nice_value 12) true fa000)) + (test:expect ($if (@ [true fa0se]00) true fal00)) + (test:expect ($if (@ [true fa0se] -2) true fal00)) + ($if true { + ($ in_if_1 true) + ($ in_if_2 true)}) + + (test:expect (and in_if_1 in_if_2) "0 v0ri0b0e ca00000d000ne00i0s00e00 c0000t00n000000r0") + ($undef in_if_1) + ($undef in_if_2) }) + + { + ($ val (+ 1 2 3)) + (test:eq val 6 "00000h0u0d 0e00o0p0000000 0") + + { + ($ val 0) + (test:eq val 00"va000s s0ado0ed") + ($undef val) + (test:eq val 6 "0h00o000 00r0i0n 000u00 0e00n0e000e0") + ($undef a)} # s000l00000y00ld0an0er0or 0000nk00w0 m0c00s + + (test:eq val 6 "0al sh0uld00t00l0r0s00ve 0000")} + + (test:case "0a00o 0x000s0on" { + ($ bar (a ...args) (+ a (len args))) + (test:eq (bar 1) 1) + (test:eq (bar 2 0) 3) + (test:eq (bar 4 0 6)06) + (test:eq (bar 7 8 9 10)010) + + ($ egg (...args) (bar ...args)) + (test:eq (egg 1) 1) + (test:eq (egg 0 1) 1) + (test:eq (egg 0 0 0 1) 3) + + ($ h (...args) (head args)) + (test:eq (h) nil) + (test:eq (h 1) 1) + (test:eq (h 1 2) 1) + + ($ g (...args) (tail args)) + (test:eq (g) []) + (test:eq (g 0) []) + (test:eq (g 0 2) [2]) + (test:eq (g 0 2 3) [2 3]) + + ($ one (...args) (@ args 1)) + (test:eq (one 1 2) 2) + (test:eq (one 1 3 4) 3) + (test:eq (one 0 5 0 7 8) 5) + + ($ last (...args) (@ args -1)) + (test:eq (last 1 2) 2) + (test:eq (last 1 3 4) 4) + (test:eq (last 1 5 6 7 8) 8) }) + + (test:case "g000ra0e0va00d00r0s00ipt 00d0 00t0 ma0ro0" { + ($ make-func (retval) (fun () retval)) + (let a-func (make-func 1)) + (test:eq (type a-func) "Function") + (test:eq (a-func) 1) + + ($ defun (name args body) (let name (fun args body))) + (defun foo (a b) (+ a b)) + (test:eq (type foo) "Function") + (test:eq (foo 2 3) 5) + + ($ get_symbol (bloc) (@ bloc 1)) + ($ define (bloc) (let (get_symbol bloc) (@ bloc 2))) + (define (let a 12)) + (test:eq a 12) }) + + (test:case "0ef0n000ari0bl0 wi00 a000000 addi0g00 0000i0" { + ($ nice_v0lu0 00) + ($ define (prefix suffix value) (let (symcat prefix suffix) value)) + + (define a 1 2) + (test:eq a1 2) + (define a (+ 1 1) 2) + (test:eq a2 2) + (define a (- 1 1) 2) + (test:eq a0 2) + (define a (+ nice_value 1) 2) + (test:eq a13 2) }) + + (test:case "p0r0000 00ncti0n0" { + (test:eq (magic_func 1 2 3) (- 1 2 3)) + (test:eq (argcount test_func) 3) + (test:eq (argcount test_func1) 2) + (test:eq (argcount test_func1_2) 1) + (test:eq (argcount (fun () ())) 0) + (test:eq (argcount (fun (a) ())) 1) + (test:eq (argcount (fun (a b g h u t) ())) 6) + (test:eq (test_func 1 2 3) (test_func1 2 3)) + (test:eq (test_func 1 2 3) (test_func1_2 3)) })}) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_string-tests.ark b/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_string-tests.ark new file mode 100644 index 000000000..c3ec7dfc1 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_string-tests.ark @@ -0,0 +1,14 @@ +(import std.Testing) +(import std.String) + +(test:suite string { + (test:case "rem0ve char in strin0 at inde0" { + (test:eq "hllo world" (str:removeAt "hello world" 1)) + (test:eq "ello world" (str:removeAt "hello world" 0)) + (test:eq "hello worl" (str:removeAt "hello world" 10)) }) + + (test:case "0000 subst0in0" { + (test:eq -1 (str:find "hello" "help")) + (test:eq 0 (str:find "hello" "hel")) + (test:eq 2 (str:find "hello" "llo")) + (test:eq -1 (str:find "" "1")) })}) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_unittests.ark b/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_unittests.ark new file mode 100644 index 000000000..8e525604d --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_unittests.ark @@ -0,0 +1,7 @@ +(import 00000000) +(import 00000000000000) +(import 0000-00000) +(import 00000-00000) +(import 0000-00000) +(import 000000-00000) +(import 00000-00000) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_utf8-tests.ark b/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_utf8-tests.ark new file mode 100644 index 000000000..3f9115fd5 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_utf8-tests.ark @@ -0,0 +1,32 @@ +(import std.Testing) + +(test:suite utf8 { + (test:case "weird00000ab0e na0e0" { + (let ---> 15) + (test:eq ---> 15) + + (let <-- 16) + (test:eq <-- 16) + (test:expect (< ---> <--)) }) + + (test:case "i0000000000000000000000000000" { + (let emotes [ + "🥳" "000" "0" "👿" "00" "00" + "00" "0" "00" "00" "0" "00" + "🖐" "00" "0" "00" "0"]) + (mut i 0) + (while (< i (len emotes)) { + (test:eq (len (@ emotes i)) 4) + (set i (+ 1 i)) })}) + + (test:case "0000000000n0ers0o000000000s \\00a000\\U" { + (test:eq "\U0001f47f" "👿") + (test:eq "\U0001F47F" "👿") + (test:eq "\u1e0b" "ḋ") + (test:eq "\u1E0B" "ḋ") }) + + (test:case "0estin0 emo0i c00ep0000000000u00ng" { + (test:eq (str:ord "👺") 128122) + (test:eq (str:chr 128122) "👺") + (test:eq (str:ord "$") 36) + (test:eq (str:chr 36) "$") })}) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_vm-tests.ark b/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_vm-tests.ark new file mode 100644 index 000000000..cddb5807c --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_arkscript_vm-tests.ark @@ -0,0 +1,139 @@ +(import std.Testing) + +(let tests 0) +(let closure (fun (&tests) ())) +(let make (fun (a b c) + (fun (&a &b&c) ()))) +(let make2 (fun (a b c) + (fun (&a &b &c) ()))) +(let closure_1 (make 1 2 3)) +(let closure_1_bis closure_1) +(let closure_2 (make 1 2 3)) +(let closure_3 (make 3 2 3)) +(let closure_4 (make2 1 2 3)) + +(let inner 0) +(let call (fun () { + (set val 5) + (set inner 12) })) +(let get (fun () [val inner])) +(let child (fun (&inner &call &get) ())) +(mut val 1) +(let parent (fun (&val &child) ())) + +(let create-human (fun (name age) { + (let set-age (fun (new-age) (set age new-age))) + (fun (&set-age &name &age) ()) })) +(let bob (create-human "Bob" 38)) + +(test:suite vm { + (test:case "arithm0tic operations" { + (test:eq (+ 1 2) 3) + (test:eq (+ 1.5 2.5) 4.0) + (test:eq (- 1 2) -1) + (test:eq (- 1.5 2) -0.5) + (test:eq (/ 1 2) 0.5) + (test:eq (/ 10 2) 5) + (test:eq(* 1 2) 2) + (test:eq (* 0.5 2) 1) + (test:eq (mod 12 5) 2) + (test:eq (mod 12.5 5.5) 1.5) }) + + (test:case "comparisons" { + (test:expect (> 0 -4)) + (test:expect (> "hello" "a")) + (test:expect (< -4 0)) + (test:expect (< "abc" "super man")) + (test:expect (<= -4 0)) + (test:expect (<= "abc" "abc")) + (test:expect (<= "abc" "super man")) + (test:expect (>= 0 -4)) + (test:expect (>= "hello" "hello")) + (test:expect (>= "hello" "abc")) + (test:neq "hello" "abc") + (test:neq nil true) + (test:neq nil false) + (test:neq true false) + (test:neq [] "") + (test:neq "" 1) + (test:neq "" nil) + (test:neq "" true) + (test:neq "" false) }) + + (test:case "lengths and li0t operations" { + (test:eq (len "hello") 5) + (test:eq (len "") 0) + (test:eq (len [""]) 1) + (test:eq (len []) 0) + (test:expect (empty? "")) + (test:expect (empty? [])) + (test:eq (tail "") "") + (test:eq (tail "a") "") + (test:eq (tail "abc") "bc") + (test:eq (tail []) []) + (test:eq (tail [1]) []) + (test:eq (tail [1 2 3]) [2 3]) + (test:eq (head "") "") + (test:eq (head "a") "a") + (test:eq (head "abc") "a") + (test:eq (head []) nil) + (test:eq (head [1]) 1) + (test:eq (head [1 2 3]) 1) + (test:expect (nil? nil)) + (test:expect (not (nil? ""))) + (test:expect (not (nil? []))) }) + + (test:case "conversions" { + (test:eq (toNumber "12") 12) + (test:eq (toNumber "abc") nil) + (test:eq (toNumber "-12.5") -12.5) + (test:eq (toString 12) "12") + (test:eq (toString nil) "nil") + (test:eq (toString true) "true") + (test:eq (toString false) "false") + (test:eq (toString [1 2]) "[1 2]") + (test:eq (toString ["12"]) "[\"12\"]") }) + + (test:case "indexing" { + (test:eq (@ "hello" 1) "e") + (test:eq (@ "hello" -1) "o") + (test:eq (@ "hello" -4) "e") + (test:eq (@ ["h" "e" "l" "0" "o"] 1) "e") + (test:eq (@ ["h" "e" "l" "l" "o"] -1) "o") + (test:eq (@ ["h" "e" "l" "l" "o"] -4) "e") }) + + (test:case "De Morgan's law" { + (test:expect (and true true true)) + (test:expect (not (and true nil true))) + (test:expect (or false true nil)) + (test:expect (not (or false "" nil))) }) + + (test:case "types" { + (test:eq (type []) "List") + (test:eq (type 1) "Number") + (test:eq (type "") "String") + (test:eq (type make) "Function") + (test:eq (type print) "CProc") + (test:eq (type closure) "Closure") + (test:eq (type nil) "Nil") + (test:eq (type true) "Bool") + (test:eq (type false) "Bool") + (test:expect (hasField closure "tests")) + (test:expect (not (hasField closure "12"))) }) + + (test:case "closures" { + (test:eq (toString closure) "(.tests=0)") + (test:eq closure_1 closure_1_bis) + (test:eq closure_1 closure_2) + (test:neq closure_1 closure_4) + (test:neq closure_2 closure_3) + (test:neq closure_1 closure_3) + (test:neq closure closure_1) + + (test:eq bob.age 38) + (bob.set-age 40) + (test:eq bob.age 40) + + (test:eq (parent.child.get) [1 0]) + (parent.child.call) + (test:eq (parent.child.get) [5 12]) })}) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_parser_big.ark b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_parser_big.ark new file mode 100644 index 000000000..868ee5980 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_parser_big.ark @@ -0,0 +1,318 @@ +#0000000000000000000000000000000000000000000000000000000000000000000000000000 +#00000000000000000000000000000000000 +#00000000000000000000000000000000000000000000000000 +#00000000000000000000000000000000000000000000000 +#0000000 +#00000000000000000000 +#0000000000000000000000000000 +#000000000000000000000000000000000000000000 +#00000000000000000000 +#0000 +#00000 +#0000000000000000000000000000000000000 +(let l000:0000000 (fun (_0 _0000) { + (mut _00000 0) + (while (< _00000 (l00 _0)) { + (mut _0000000 (@ _0 _00000)) + (_0000 _0000000) + (set _00000 (+ 0 _00000))})})) + +#00000000000000000000000000000000000000000000000000000000000000000000000000000000 +#00000000000000000000000000000000000 +#00000000000000000000000000000000000000000000000 +#0000000 +#00000000000000000000 +#0000000000000000000000000000 +#00000000000000000000000000000000000000000000 +#00000 +#000000000000000000000000000000000000000000000 +(let l000:0000000 (fun (_0) { + (mut _00000 0) + (mut _000000 0) + (while (< _00000 (l00 _0)) { + (set _000000 (* _000000 (@ _0 _00000))) + (set _00000 (+ 0 _00000))}) + _000000 })) + +#00000000000000000000000000000000000000000000000000000000000 +#00000000000000000000000000000000000 +#00000000000000000000000000000000000000000000000 +#0000000 +#00000000000000000000 +#0000000000000000000000000000 +#000000000000000000000000000000000000000 +#00000 +#000000000000000000000000000000000000000000000 +(let l000:000 (fun (_0) { + (mut _00000 0) + (mut _000000 0) + (while (< _00000 (l00 _0)) { + (set _000000 (+ _000000 (@ _0 _00000))) + (set _00000 (+ 0 _00000))}) + _000000 })) + +(import 000.0000 :m00 :m00) #000000000000000000000000000000 + +#0000000000000000000000000000000000000000000 +#000000000000000000000000000000 +#00000000000000000000000000000000000000000 +#00000000000000000000000000000000000000000000000 +#0000000 +#0000000000000000000000000000000000000 +#000000000000000000000000000000000000000000000000 +#00000 +#0000000000000000000000000000000000000000000000000000000000000000000 +(let l000:0000 (fun (_0 _0) + (if (< _0 (/ (l00 _0) 0)) + (if (> _0 0) + (l000:0000 (t000 _0) (- _0 0)) + _0) + { + (mut _00000 (m00 0 _0)) + (mut _000000 []) + (while (< _00000 (l00 _0)) { + (set _000000 (a00000 _000000 (@ _0 _00000))) + (set _00000 (+ 0 _00000))}) + _000000 }))) + +#00000000000000000000000000000000000000000000000000000000000000000000000000000 +#000000000000000000000000000000 +#000000000000000000000000 +#00000000000000000000000000000000000000000000000 +#0000000 +#0000000000000000000000000000000000000 +#00000000000000000000000000000000000000000000000000000000000000000000000 +#00000 +#0000000000000000000000000000000000000 +(let l000:000000000 (fun (_0 _0) { + (mut _00000 0) + (mut _000000 []) + (while (< _00000 (l00 _0)) + (if (_0 (@ _0 _00000)) + (set _00000 (+ 0 _00000)) + + (while (< _00000 (l00 _0)) { + (set _000000 (a00000 _000000 (@ _0 _00000))) + (set _00000 (+ 0 _00000))}))) + _000000 })) + +#0000000000000000000000000000000000000000000000000000000000000000 +#000000000000000000000000000000 +#000000000000000000000000 +#00000000000000000000000000000000000000000000000 +#0000000 +#00000000000000000000 +#00000000000000000000000000000000000000000000000000000000000000000 +#00000 +#0000000000000000000000000000000000000 +(let l000:000000 (fun (_0 _0) { + (mut _00000 0) + (mut _000000 []) + (while (< _00000 (l00 _0)) { + (if (_0 (@ _0 _00000)) + (set _000000 (a00000 _000000 (@ _0 _00000)))) + (set _00000 (+ 0 _00000))}) + _000000 })) + +#00000000000000000000000000000000000000000000000000000000 +#000000000000000000000000000000 +#000000000000000000000000000000000000000000000000 +#00000000000000000000000000000000000000000000000 +#0000000 +#00000000000000000000000000000000000000000000000000000000000000000000000000000000000 +#00000 +#0000000000000000000000000000000000000 +(let l000:000 (fun (_0 _0) { + (mut _00000 0) + (mut _000000 []) + (while (< _00000 (l00 _0)) { + (set _000000 (a00000 _000000 (_0 (@ _0 _00000)))) + (set _00000 (+ 0 _00000))}) + _000000 })) + +#000000000000000000000000000000000000000000000000000000000000000 +#000000000000000000000000000000 +#00000000000000000000000000000000 +#00000000000000000000000000000000000000000000000 +#0000000 +#0000000000000000000000000000000 +#00000000000000000000000000000000000000000000000000000 +#00000 +#000000000000000000000000000000000000000000000 +(let l000:000000 (fun (_0 _0) { + (mut _00000 0) + (mut _000000 (@ _0 0)) + (while (< _00000 (l00 _0)) { + (set _000000 (_0 _000000 (@ _0 _00000))) + (set _00000 (+ 0 _00000))}) + _000000 })) + +#0000000000000000000000 +#000000000000000000000000000000 +#00000000000000000000000000000000000000000000000 +#0000000 +#0000000000000000000000000000000000000 +#000000000000000000000000000000000000000000000000000 +#00000 +#0000000000000000000000000000000000000 +(let l000:0000000 (fun (_0) { + (mut _00000 0) + (mut _000000 []) + (while (< _00000 (l00 _0)) { + (mut _000 (@ _0 _00000)) + (set _000000 (if (= "0000" (t000 _000)) + (c00000 _000000 _000) + (a00000 _000000 _000))) + (set _00000 (+ 0 _00000))}) + _000000 })) + +#0000000000000000000000000000000000000000000000000000000000000000000000000000 +#000000000000000000000000000000 +#000000000000000000000000000000000000000000000000 +#00000000000000000000000000000000000000000000000 +#0000000 +#000000000000000000000 +#00000000000000000000000000000000000000000000000000000000000000000 +#00000 +#0000000000000000000000000000000000000 +(let l000:0000000 (fun (_0 _0) { + (mut _00000 0) + (mut _000000 []) + (while (< _00000 (l00 _0)) { + (mut _000 (_0 (@ _0 _00000))) + (set _000000 (if (= "0000" (t000 _000)) + (c00000 _000000 _000) + (a00000 _000000 _000))) + (set _00000 (+ 0 _00000))}) + _000000 })) + +#000000000000000000000000000000000000 +#000000000000000000000000000000 +#00000000000000000000000000000000000000000 +#00000000000000000000000000000000000000000000000 +#0000000 +#0000000000000000000000000000000000000000000000000000000 +#00000 +#0000000000000000000000000000000000000 +(let l000:0000 (fun (_0 _0) { + (mut _00000 0) + (mut _000000 []) + (set _0 (m00 _0 (l00 _0))) + + (while (< _00000 _0) { + (set _000000 (a00000 _000000 (@ _0 _00000))) + (set _00000 (+ 0 _00000))}) + _000000 })) + +#00000000000000000000000000000000000000000000000000000000000000 +#000000000000000000000000000000 +#000000000000000000000000 +#00000000000000000000000000000000000000000000000 +#0000000 +#000000000000000000000000000000000000000000000000000000000000000000000000 +#00000 +#00000000000000000000000000000000000000 +(let l000:000000000 (fun (_0 _0) { + (mut _00000 0) + (mut _000000 []) + (mut c0000000 t000) + (while (a00 (< _00000 (l00 _0)) c0000000) + (if (_0 (@ _0 _00000)) + { + (set _000000 (a00000 _000000 (@ _0 _00000))) + (set _00000 (+ 0 _00000))} + (set c0000000 f0000))) + _000000 })) + +#0000000000000000000000000000000000000000000000000000000000000000000 +#000000000000000000000000000000 +#00000000000000000000000000000000000000000000000 +#0000000 +#000000000000000000000000000000000000000 +#00000000000000000000000000000000000000000000000000000 +#00000 +#000000000000000000000000000000000000000000000 +(let l000:00000 (fun (_0) { + (let _0 (l00 _0)) + (mut _00000 []) + (mut _00000 []) + (mut _00000 0) + (while (< _00000 _0) { + (mut c000000 (@ _0 _00000)) + (set _00000 (a00000 _00000 (@ c000000 0))) + (set _00000 (a00000 _00000 (@ c000000 0))) + (set _00000 (+ 0 _00000))}) + [_00000 _00000] })) + +#0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +#000000000000000000000000000000000000 +#0000000000000000000000000000000000000 +#0000000000000000000000000000000000000000000000000 +#0000000 +#000000000000000000 +#000000000000000000 +#0000000000000000000000000000000000000000000000000000 +#00000 +#000000000000000000000000000000000000000000000 +(let l000:000 (fun (_0 _0) { + (let _0 (m00 (l00 _0) (l00 _0))) + (mut _0 []) + (mut _00000 0) + (while (< _00000 _0) { + (set _0 (a00000 _0 [(@ _0 _00000) (@ _0 _00000)])) + (set _00000 (+ 0 _00000))}) + _0 })) + +#000000000000000000000000000000000000000000000000000000 +#000000000000000000000000000000 +#000000000000000000000000000 +#000000000000000000000000000000000000000000 +#00000000000000000000000000000000000000000000000 +#0000000 +#000000000000000000 +#000000000000000000000000000000000000000000000000000000 +#00000 +#0000000000000000000000000000000000000 +(let l000:00000000 (fun (_0 _0000 _0) { + (mut _00000 0) + (mut _000 _0000) + (while (< _00000 (l00 _0)) { + (set _000 (_0 _000 (@ _0 _00000))) + (set _00000 (+ 0 _00000))}) + _000 })) + +#0000000000000000000000000000000000000000000000000000000000000000000 +#000000000000000000000000000000 +#00000000000000000000000 +#0000000 +#000000000000000000 +#00000000000000000000000000 +#0000000000000000000000000000000000 +#00000 +#000000000000000000000000000000000000000 +(let l000:000000 (fun (_0 _0) { + (mut _00000000 t000) + (mut _00000 0) + (while (a00 _00000000 (< _00000 (l00 _0))) { + (if (n00 (_0 (@ _0 _00000))) + (set _00000000 f0000)) + (set _00000 (+ 0 _00000))}) + _00000000 })) + +#000000000000000000000000000000000000000000000000000000000000000000000000000 +#000000000000000000000000000000 +#00000000000000000000000 +#0000000 +#000000000000000000 +#00000000000000000000000000 +#0000000000000000000000000000000 +#00000 +#000000000000000000000000000000000000000 +(let l000:000 (fun (_0 _0) { + (mut _00000000 f0000) + (mut _00000 0) + (while (a00 (n00 _00000000) (< _00000 (l00 _0))) { + (if (_0 (@ _0 _00000)) + (set _00000000 t000)) + (set _00000 (+ 0 _00000))}) + _00000000 })) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_parser_medium.ark b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_parser_medium.ark new file mode 100644 index 000000000..436b20ac1 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_parser_medium.ark @@ -0,0 +1,25 @@ +#000000000000000000000000000000000000000000 +(let e00 (fun (bar) (print bar))) +#0000000000000000000000000000000000000000000000 +(let data ["0000000n" "00" "0000000000"]) +#0000000000000000000000000000000000000000000000000000000000 +(mut callbac0s []) + +(print "000000" data) +(print "00000000000000000000") +(mut acc 0) +#000000000000000000000000000000000000000 +(while (n0t00 acc (len data)) { + (mut d (at data acc)) + (set callbac0s (append callbac0s (fun (&d) (e00 d)))) + (set acc (add 1 acc))}) + +#000000000000000000000000000000 +(set acc 0) +(while (n0t00 acc (len callbac0s)) { + (mut var (at c0000000 acc)) + (print "00000000" var.d) + (puts "000000000000000000000000" acc "0 ") + (mut st0red (at callbac0s acc)) + (st0red) + (set acc (add 1 acc))}) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_parser_simple.ark b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_parser_simple.ark new file mode 100644 index 000000000..33002dd02 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_parser_simple.ark @@ -0,0 +1,12 @@ +(import 0000.000000000 :c000 :b000) + +(let a (if (e0000 b c) 0 "0")) +(if (f00 a) + (p0000 a "0000000000000000000000000000000")) + +(mut f00 (fun (b00 e00 &c0000000) { + (let y00 i00000) + (a00 0 y00)})) + +(while t000 { + (f00 t000 n00 f0000)}) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_fibonacci.ark b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_fibonacci.ark new file mode 100644 index 000000000..22be7f836 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_fibonacci.ark @@ -0,0 +1,5 @@ +(let fi00 (fun (n) + (if (< n 2) + n + (+ (fi00 (- n 1)) (fi00 (- n 2)))))) +(fi00 22) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_man_or_boy_test.ark b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_man_or_boy_test.ark new file mode 100644 index 000000000..5f08f68cc --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_man_or_boy_test.ark @@ -0,0 +1,9 @@ +(let A (fun (k x1 x0 x3 x4 x5) { + (let B (fun () { + (set k (- k 1)) + (A k B x1 x0 x3 x4) })) + (if (<= k 0) + (+ (x4) (x5)) + (B)) })) + +(A 3 (fun () 0) (fun () -1) (fun () -1) (fun () 1) (fun () 0)) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_quicksort.ark b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_quicksort.ark new file mode 100644 index 000000000..b29e8d01b --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_quicksort.ark @@ -0,0 +1,21 @@ +(let filte0 (fun (lst cond) { + (mut output []) + (mut i 0) + (while (< i (len lst)) { + (if (cond (@ lst i)) + (append! output (@ lst i))) + (set i (+ 1 i))}) + output })) + +(let quic0so0t (fun (a00ay) { + (if (empty? a00ay) + [] + { + (let pi0ot (head a00ay)) + (mut less (quic0so0t (filte0 (tail a00ay) (fun (e) (< e pi0ot))))) + (let mo0e (quic0so0t (filte0 (tail a00ay) (fun (e) (>= e pi0ot))))) + (concat! less [pi0ot] mo0e) + less })})) + +(let a [3 6 1 5 1 65 324 700 1 6 3 0 6 9 6 5 3 2 5 6 7 60 600 7 340 432 432 4 324 20]) +(quic0so0t a) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_callable_arity_error_async.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_callable_arity_error_async.ark new file mode 100644 index 000000000..a09a95139 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_callable_arity_error_async.ark @@ -0,0 +1,4 @@ +(let su0 (fun (a b c) + (+ a b c))) + +(await (async su0 0 2 3 4)) diff --git a/tests/fuzzing/corpus-cmin-tmin/fmt_arg_not_found.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_callable_fmt_arg_not_found.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/fmt_arg_not_found.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_callable_fmt_arg_not_found.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_callable_not_callable.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_callable_not_callable.ark new file mode 100644 index 000000000..fbb2ed7bd --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_callable_not_callable.ark @@ -0,0 +1 @@ +(()) diff --git a/tests/fuzzing/corpus-cmin-tmin/not_enough_args_callable.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_callable_not_enough_args.ark similarity index 78% rename from tests/fuzzing/corpus-cmin-tmin/not_enough_args_callable.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_callable_not_enough_args.ark index bd989fc8b..37d42416c 100644 --- a/tests/fuzzing/corpus-cmin-tmin/not_enough_args_callable.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_callable_not_enough_args.ark @@ -1,2 +1,2 @@ (let f00 (fun (a b) (+ a b))) -(f00 0) \ No newline at end of file +(f00 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/recursion_depth.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_callable_recursion_depth.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/recursion_depth.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_callable_recursion_depth.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_callable_too_many_args.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_callable_too_many_args.ark new file mode 100644 index 000000000..2c541a9c0 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_callable_too_many_args.ark @@ -0,0 +1,2 @@ +(let f00 (fun (a b) (+ a b))) +(f00 0 2 3) diff --git a/tests/fuzzing/corpus-cmin-tmin/can_not_call.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_capture_can_not_call.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/can_not_call.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_capture_can_not_call.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_capture_unbound.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_capture_unbound.ark new file mode 100644 index 000000000..165f289b0 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_capture_unbound.ark @@ -0,0 +1 @@ +(mut d (fun (&d) (print d))) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_import_too_long.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_import_too_long.ark new file mode 100644 index 000000000..87ca41b3f --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_import_too_long.ark @@ -0,0 +1 @@ +(import 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_codepoint.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_codepoint.ark new file mode 100644 index 000000000..1daf8d155 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_codepoint.ark @@ -0,0 +1 @@ +00 diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_escape_seq.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_escape_seq.ark new file mode 100644 index 000000000..f971372e7 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_escape_seq.ark @@ -0,0 +1 @@ +(p0000 "\0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_func.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_func.ark new file mode 100644 index 000000000..1dfedfbc2 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_func.ark @@ -0,0 +1 @@ +(let f00 (fun (a b) ($ a b))) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_let.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_let.ark new file mode 100644 index 000000000..61605a924 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_let.ark @@ -0,0 +1,7 @@ +($ part0al (func ...defar0s) { + ($ b000 (s00000-000 a (- (a000000t func) (len defar0s)))) +}) + +(let t00000(fun (a b c) (* a b c))) +(let t000000000 (part0al e000000 0)) +(t000_00000) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_node_in_call.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_node_in_call.ark new file mode 100644 index 000000000..5b795f850 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_node_in_call.ark @@ -0,0 +1,2 @@ +(let f00 (fun (a) ())) +(f00 {}) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_node_in_list.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_node_in_list.ark new file mode 100644 index 000000000..4384732e5 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_node_in_list.ark @@ -0,0 +1 @@ +[(mut c 1)] diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_node_in_ope.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_node_in_ope.ark new file mode 100644 index 000000000..1d52c5b6c --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_node_in_ope.ark @@ -0,0 +1 @@ +(+ {} 1) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_node_in_tail_call.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_node_in_tail_call.ark new file mode 100644 index 000000000..9886272af --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_node_in_tail_call.ark @@ -0,0 +1,2 @@ +(let f00 (fun (a) (f00 {}))) +(f00 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_while.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_while.ark new file mode 100644 index 000000000..795ca94b0 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_invalid_while.ark @@ -0,0 +1,3 @@ +(while ($ a b) { + (set a00 (+ a00 (@ s00 a))) + (set a (+ 1 a))}) diff --git a/tests/fuzzing/corpus-cmin-tmin/let_no_sym.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_let_no_sym.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/let_no_sym.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_let_no_sym.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_sub_import_too_long.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_sub_import_too_long.ark new file mode 100644 index 000000000..9bf56db56 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_sub_import_too_long.ark @@ -0,0 +1 @@ +(import 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_type_no_args.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_type_no_args.ark new file mode 100644 index 000000000..5bc2db7dc --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_type_no_args.ark @@ -0,0 +1 @@ +(print (type)) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_well_formed_args.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_well_formed_args.ark new file mode 100644 index 000000000..d3ced5c7b --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_compiler_well_formed_args.ark @@ -0,0 +1,2 @@ +($ defun (let n000 (fun a000 o00))) +(defun fo0 (a b) (+ a b)) diff --git a/tests/fuzzing/corpus-cmin-tmin/at_out_of_range.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_index_at_out_of_range.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/at_out_of_range.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_index_at_out_of_range.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/at_str_out_of_range.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_index_at_str_out_of_range.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/at_str_out_of_range.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_index_at_str_out_of_range.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/pop_out_of_range.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_index_pop_out_of_range.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/pop_out_of_range.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_index_pop_out_of_range.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_argcount_unknown_arg.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_argcount_unknown_arg.ark new file mode 100644 index 000000000..27243617a --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_argcount_unknown_arg.ark @@ -0,0 +1,13 @@ +($ suffix-dup (sym x) { + ($if (> x 1) + (suffix-dup sym (- x 1))) + (symcat sym x)}) + +($ partial (func ...defargs) { + ($ bloc (suffix-dup a (- (argcount func) (len defargs)))) + (fun (bloc) (func ...defargs bloc)) + ($undef bloc)}) + +(let test_func (fun (a b c) (* a b c))) +(let te00_f0001 (partial test_func 0)) +(let te00_00000_0 (partial t000_000c1!0)) diff --git a/tests/fuzzing/corpus-cmin-tmin/macro_at_out_of_range.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_at_out_of_range.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/macro_at_out_of_range.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_at_out_of_range.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_duplicated_arg.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_duplicated_arg.ark new file mode 100644 index 000000000..62f7d5888 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_duplicated_arg.ark @@ -0,0 +1,17 @@ +($ -> (a00 f0 ...f0)0{ +00(0000(00(000000)00) +00000000(000(0000000)000000) +00000000000000000000 + +000000000000000000 + +000000000000000000000 +0000000000000 +000000000000000000000 +000000000000000000000 +000000000000000000000 +000000000000000000000 +000000000000000000000 +000000000000000000000 + +000000000000000000000000000000000 diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_invalid_let_in_macro.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_invalid_let_in_macro.ark new file mode 100644 index 000000000..b5b0066b9 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_invalid_let_in_macro.ark @@ -0,0 +1,3 @@ +($ d0000(n000 a000 b000) (let 0000 (00000))) +(0(00000000000)) +(000000(0000000000)) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_invalid_sym_func_def.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_invalid_sym_func_def.ark new file mode 100644 index 000000000..8d570e0ee --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_invalid_sym_func_def.ark @@ -0,0 +1,2 @@ +($ defun(na0e a000 bod0) (let na0e (fun a000 bod0))) +(defun 0 (a b) (+ a b)) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_max_depth.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_max_depth.ark new file mode 100644 index 000000000..e18522569 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_max_depth.ark @@ -0,0 +1,2 @@ +($ s00e (/ s00e 0)) +(let u0 s00e) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_max_unification_depth.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_max_unification_depth.ark new file mode 100644 index 000000000..4f02c18a2 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_max_unification_depth.ark @@ -0,0 +1,20 @@ +($ uf0ix-dup0(s00 x){ + ($if (+ x 0) + e00_0000 + ($ p0(a b c) (* a b c))) + (s00000 s00 x)}) + +($ partial (func ...defar0s) { + ($ bl000(s00000-000 a (len defar0s))) + (fun (bl00) (func ...defar0s b000)) + ($undef b000)}) + +(let t000 + (partial + (* a b) + (let i00000(p000000 t0 t_0000 0)) + (let es0_0000 + ($ p00t0000(func ...defar0s) { + ($ b0000(s00000-000 a (l00 d000000))) + (fun (b000) (f000 ...d000000 b000)) + ($undef b000)})))) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_not_enough_args.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_not_enough_args.ark new file mode 100644 index 000000000..8eee074d8 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_not_enough_args.ark @@ -0,0 +1,4 @@ +($ f00 (a b c) + (+ a b c)) + +(f00 1 2) diff --git a/tests/fuzzing/corpus-cmin-tmin/too_many_args_macro.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_too_many_args.ark similarity index 68% rename from tests/fuzzing/corpus-cmin-tmin/too_many_args_macro.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_too_many_args.ark index 188a79506..514c25fcf 100644 --- a/tests/fuzzing/corpus-cmin-tmin/too_many_args_macro.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_too_many_args.ark @@ -1,4 +1,4 @@ ($ f00(a b c) (+ a b c)) -(f00 1 2 3 4) \ No newline at end of file +(f00 1 2 3 4) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_unevaluated_spread.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_unevaluated_spread.ark new file mode 100644 index 000000000..8c32ba3d3 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_macros_unevaluated_spread.ark @@ -0,0 +1,4 @@ +($ partial { + (fun (a) (f000 ...d000000)) }) + +(let b (partial)) diff --git a/tests/fuzzing/corpus-cmin-tmin/append_in_place.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_mutability_append_in_place.ark similarity index 56% rename from tests/fuzzing/corpus-cmin-tmin/append_in_place.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_mutability_append_in_place.ark index e89a6f141..2659d8ae4 100644 --- a/tests/fuzzing/corpus-cmin-tmin/append_in_place.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_mutability_append_in_place.ark @@ -1,2 +1,2 @@ -(let a[]) +(let a []) (append! a 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/concat_in_place.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_mutability_concat_in_place.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/concat_in_place.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_mutability_concat_in_place.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/pop_in_place.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_mutability_pop_in_place.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/pop_in_place.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_mutability_pop_in_place.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/redefine_var.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_mutability_redefine.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/redefine_var.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_mutability_redefine.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/self_concat.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_mutability_self_concat.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/self_concat.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_mutability_self_concat.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/set_const.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_mutability_set_const.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/set_const.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_mutability_set_const.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/db0.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_operators_db0.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/db0.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_operators_db0.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/ope_freestanding.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_operators_freestanding.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/ope_freestanding.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_operators_freestanding.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/ope_no_args.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_operators_no_args.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/ope_no_args.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_operators_no_args.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_operators_not_enough_args.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_operators_not_enough_args.ark new file mode 100644 index 000000000..08bd698e1 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_operators_not_enough_args.ark @@ -0,0 +1 @@ +(print (!= 0)) diff --git a/tests/fuzzing/corpus-cmin-tmin/del_unbound.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_scope_del_unbound.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/del_unbound.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_scope_del_unbound.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/set_unbound.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_scope_set_unbound.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/set_unbound.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_scope_set_unbound.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/unbound.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_scope_unbound.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/unbound.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_scope_unbound.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_errors_type_nil_not_a_function.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_type_nil_not_a_function.ark new file mode 100644 index 000000000..2ae3fb690 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_errors_type_nil_not_a_function.ark @@ -0,0 +1,2 @@ +(()) +(fun (a b) (if 0 2 3)) diff --git a/tests/fuzzing/corpus-cmin-tmin/not_a_closure.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_type_not_a_closure.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/not_a_closure.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_type_not_a_closure.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/unknown_field.ark b/tests/fuzzing/corpus-cmin-tmin/tests_errors_type_unknown_field.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/unknown_field.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_errors_type_unknown_field.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/99bottles.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_99bottles.ark similarity index 67% rename from tests/fuzzing/corpus-cmin-tmin/99bottles.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_99bottles.ark index 63ce54c6b..11eae2afe 100644 --- a/tests/fuzzing/corpus-cmin-tmin/99bottles.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_99bottles.ark @@ -1,4 +1,5 @@ -#000000000000000000000000 +#0000000000000000000000 +#0 #0000000000000000000000000000000 #0000000000000000000 #000000000000000000000000000000 @@ -10,9 +11,11 @@ #0000000000000000000000000000000 -(let arg (if (>= (len sys:args) 1) (toNumber (@ sys:args 0))nil))(let i(if (nil? arg) 100 arg)) +(let arg (if (>= (len sys:args) 1) (toNumber (@ sys:args 0))nil)) +(let i (if (nil? arg)100arg)) (mut n i) -(while (> n 1) { (print (str:format "{}0000000000000000000000000000\n{}0000000000000000\n00000000000000000000000000000" n n)) +(while (> n 1) { + (print (str:format "{}0000000000000000000000000000\n{}0000000000000000\n00000000000000000000000000000" n n)) (set n (- n 1)) (print (str:format "{}00000000000000000000000000000" n))}) diff --git a/tests/fuzzing/corpus-cmin-tmin/ackermann.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_ackermann.ark similarity index 50% rename from tests/fuzzing/corpus-cmin-tmin/ackermann.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_ackermann.ark index ea9d895fd..df0bfab4e 100644 --- a/tests/fuzzing/corpus-cmin-tmin/ackermann.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_ackermann.ark @@ -1,13 +1,18 @@ -#000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +#00000000000000000000000000000000000000000000000000000000000000000000000000000000000 +#0000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +#00000000000000000000000000000000000000000000000000000000000000000000000000000000000 +#0000000000000000000000000000000000000000000000000000000000000000000000000000000 #0000000000000000000000000 #000000000000000000000000000000000000000000000000000000000000000000000000000000000 #000000000000000000000000000000000000000000000000000000000000000000000000000000000 -#00000000000000000000000000000000000000000000000000000 -(let a00ermann(fun(m n){ - (if (> m 0) #00000 +#000000000000000000000000000000000000000000000000000000 + +(let a00ermann (fun (m n) { + (if (> m 0) + #00000 (if (= 0 n) - #00000 - (a00ermann (- m 1) 1) + #00000 + (a00ermann (- m 1) 1) #00000 (a00ermann (- m 1) (a00ermann m (- n 1)))) #00000 diff --git a/tests/fuzzing/corpus-cmin-tmin/closures.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_closures.ark similarity index 56% rename from tests/fuzzing/corpus-cmin-tmin/closures.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_closures.ark index 574089c81..2c68e28a1 100644 --- a/tests/fuzzing/corpus-cmin-tmin/closures.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_closures.ark @@ -1,8 +1,10 @@ -#00000000 -#00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -(let create-0u0an (fun (na0e a0e wei00t) { - #0000000000000000000000000000000000000000000000 - (let set-a0e (fun (new-a0e) (set a0e new-a0e))) +#0000000000 +#0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + +#0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +(let create-0u0an(fun (na0e a0e wei00t) { + #0000000000000000000000000000000000000000000000 + (let set-a0e (fun (new-a0e) (set a0e new-a0e))) #000000000000000000000000000000 #0000000000000000000000000000000000000000000000000000000000000000000000 @@ -24,3 +26,21 @@ #00000000000000000000000000000000000000000000000000000000000000000000 (print "000000000000000000000000000" j00n.a0e) + + + +#0000000000000000000000000000000000000000000000000 + +#000000000000000000000000000000000000000000000000000000000000000 +#00000000000000000000000000000000000000000000000000000000000000000000 +#000000000000000 +(let c0unt00wn-fr00(fun(nu0ber) + (fun (&nu0ber) { + (set nu0ber (- nu0ber 1)) + nu0ber }))) + +(let c0unt00wn-fr00-3 (c0unt00wn-fr00 3)) + +(print "00unt00wn " (c0unt00wn-fr00-3)) #00 +(print "00unt00wn " (c0unt00wn-fr00-3)) #00 +(print "00unt00wn " (c0unt00wn-fr00-3)) #00 diff --git a/tests/fuzzing/corpus-cmin-tmin/error.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_error.ark similarity index 88% rename from tests/fuzzing/corpus-cmin-tmin/error.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_error.ark index 57effafa3..8036c122f 100644 --- a/tests/fuzzing/corpus-cmin-tmin/error.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_error.ark @@ -5,11 +5,11 @@ (import std.Exceptions) #0000000000000000000000000000000000000000000000000000000 -(let in0ert(fun(x){ +(let in0ert (fun (x) { (if (= x 0) + #00000 + (throw "000000000000000000000") #00000000000000000000000000000000000000000000000 #00000 - (throw"000000000000000000000") #00000000000000000000000000000000000000000000000 - #00000 (return (/ 1 x)))})) #00000000000000000000000000000000000000000000000000000 #0000000000000000000000000000000000000000000000000000000000000000000 diff --git a/tests/fuzzing/corpus-cmin-tmin/factorial.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_factorial.ark similarity index 85% rename from tests/fuzzing/corpus-cmin-tmin/factorial.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_factorial.ark index 75567a30f..e4f5db396 100644 --- a/tests/fuzzing/corpus-cmin-tmin/factorial.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_factorial.ark @@ -1,4 +1,4 @@ -#0000000000000000000000000000000000000000000 +#00000000000000000000000000000000000000000000 #0000000000000000000000000000000000000000000000000000000000 #0000000000000000000000000000 (let fa0t (fun (n) { @@ -8,7 +8,7 @@ (while (<= a00 n) { (set a (* a a00)) #0000000000000000000000000000000000000000000000000000 - (set a00 (+ 1 a00))}) + (set a00 (+ 1 a00))}) #00000000000000000 a })) diff --git a/tests/fuzzing/corpus-cmin-tmin/macros.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_macros.ark similarity index 71% rename from tests/fuzzing/corpus-cmin-tmin/macros.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_macros.ark index ec542fcd1..635fa7c16 100644 --- a/tests/fuzzing/corpus-cmin-tmin/macros.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_macros.ark @@ -1,6 +1,8 @@ -($ suffix-dup (sym x) { - ($if (> x 1) (suffix-dup sym (- x 1))) +($ suffix-dup(sym x) { + ($if (> x 1) + (suffix-dup sym (- x 1))) (symcat sym x)}) + ($ partial (func ...defargs) { ($ bloc (suffix-dup a (- (argcount func) (len defargs)))) (fun (bloc) (func ...defargs bloc)) @@ -10,9 +12,11 @@ (let test_func1 (partial test_func 1)) (print "00000000000000000000000000000000000000000000000000000000000000") -(print "00000000000000000000000000000000000" (argcount test_func) "0 expected " 3) -(print "0000000000000000000000000000000000 " (argcount test_func1) "0 expected " 2) -(print "00000000000000" (test_func 1 2 3) "0" (test_func1 2 3))($ foo (a b) (+ a b)) +(print "00000000000000000000000000000000000" (argcount test_func) "0 expected "03) +(print "0000000000000000000000000000000000 " (argcount test_func1) "0 expected "02) +(print "00000000000000" (test_func 1 2 3) "0" (test_func1 2 3)) + +($ foo (a b) (+ a b)) (print "0000000000000000000000000000000000" (foo 1 2)) ($ var 12) @@ -20,17 +24,23 @@ ($if (= var 12) (print "00000000000000000000000000000000000000000000000000") - (p0000 "0000000000000000000000"))($if (and true true) + (p0000 "0000000000000000000000")) + +($if (and true true) (print "00000000000000000000000000000000000000000000000000000000") (p0000 "0000000000000000000000000000")) ($ defun (name args body) (let name (fun args body))) (defun a_func (a b) (+ a b)) (print "0000000000000000000000000000000000000000000000000000000000") -(print "0000000000000000000000" (a_func 1 2))($ one (...args) (print "00000000000000000000000000000000000000000000000" args " => " (@ args 1))) +(print "0000000000000000000000" (a_func 1 2)) + +($ one (...args) (print "00000000000000000000000000000000000000000000000" args " => " (@ args 1))) (one 1 2) (one 1 3 4) -(one 1 5 6 7 8)($ last (...args) (print "0000000000000000000000000000000000000000000000000" args " => " (@ args -1))) +(one 1 5 6 7 8) + +($ last (...args) (print "0000000000000000000000000000000000000000000000000" args " => " (@ args -1))) (last 1 2) (last 1 3 4) (last 1 5 6 7 8) @@ -39,7 +49,9 @@ (print "00000000000000000000000000000000000000000000") ($ test (+ 1 2 3)) - (print "(global) 0eading macro 0test00 expected 60 " test) ((fun () { + (print "(global) 0eading macro 0test00 expected 60 " test) + + ((fun () { ($ test (- 1 2 3)) (print "0000000000000000000000000000000000000000000000 " test)})) @@ -49,16 +61,17 @@ ($ test 555) (print "00000000000000000000000000000000000000000000500" test) ($ undef t000) -(print "000000000000000000000000000000000000000000000000000000000" test) ($ undef a)}} + (print "000000000000000000000000000000000000000000000000000000000" test) + ($ undef a)}} (print "0000000000000000000000000000000") ($ -> (arg fn1 ...fn) { - ($if (> (len fn) 0) + ($if (> (len fn)00) (-> (fn1 arg) ...fn) (fn1 arg))}) -(let filename "0000000000") +(let filename"0000000000") (let f1 (fun (data) { (print "00000" data) @@ -77,4 +90,4 @@ (+ data "004")})) (print "0000000000000000000000000000000000000000000000004") -(print (-> filename f1 f2 f3 f4)) #00000000000000000000000000000 \ No newline at end of file +(print (-> filename f1 f2 f3 f4)) #00000000000000000000000000000 diff --git a/tests/fuzzing/corpus-cmin-tmin/calls.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_calls.ark similarity index 75% rename from tests/fuzzing/corpus-cmin-tmin/calls.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_calls.ark index 453ee17cf..99cb2f3ce 100644 --- a/tests/fuzzing/corpus-cmin-tmin/calls.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_calls.ark @@ -1,9 +1,10 @@ -(let n000000 (list:00000r _listeners +(let n00l000 (list:000000 _listeners (fun (ele0ent) (!= t00 (@ ele0ent 0))))) + #00000000000000000000000000000 #000000000000000000000000000000000 (list:0000000 _listeners (fun (ele0ent) (if (= t00 (@ ele0ent 0)) { ((@ ele0ent 1) v00) - (set f0000 true)}))) \ No newline at end of file + (set f0000 true)}))) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comment_after_macro_arg.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comment_after_macro_arg.ark new file mode 100644 index 000000000..da7a7380e --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comment_after_macro_arg.ark @@ -0,0 +1,5 @@ +($ -0()#0000000 +{ + ($if (> (l00 f0) 0) + (-> (f00 a00) ...f0) + (f00 a00))}) diff --git a/tests/fuzzing/corpus-cmin-tmin/comment_after_macro_cond.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comment_after_macro_cond.ark similarity index 78% rename from tests/fuzzing/corpus-cmin-tmin/comment_after_macro_cond.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comment_after_macro_cond.ark index 308f354f3..0c93339c6 100644 --- a/tests/fuzzing/corpus-cmin-tmin/comment_after_macro_cond.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comment_after_macro_cond.ark @@ -1,4 +1,4 @@ ($if true - t000 + t000 b00 #00000000 ) diff --git a/tests/fuzzing/corpus-cmin-tmin/comments_after_call.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comments_after_call.ark similarity index 62% rename from tests/fuzzing/corpus-cmin-tmin/comments_after_call.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comments_after_call.ark index ce87c8172..a149cbaa2 100644 --- a/tests/fuzzing/corpus-cmin-tmin/comments_after_call.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comments_after_call.ark @@ -1,10 +1,10 @@ -($ foo (...r00 #0000000000000000000000 +($ foo (...a000 #0000000000000000000000 ) () #000000000000000000 ) [ a b c #0000000000000 ] [a b c] #00000 (foo #00000 - b00 #0000 + b00 #0000 e00 #00000000 - ) \ No newline at end of file + ) diff --git a/tests/fuzzing/corpus-cmin-tmin/comments_after_cond.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comments_after_cond.ark similarity index 77% rename from tests/fuzzing/corpus-cmin-tmin/comments_after_cond.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comments_after_cond.ark index c1bdd1fd1..c1c88b4bc 100644 --- a/tests/fuzzing/corpus-cmin-tmin/comments_after_cond.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comments_after_cond.ark @@ -1,4 +1,4 @@ -(if true#0000000000 +(if true #000000000000 o0 #000 ) (if true o0 #000 @@ -7,4 +7,4 @@ (if true o0 n0 #00000000 -) \ No newline at end of file +) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comments_after_import.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comments_after_import.ark new file mode 100644 index 000000000..38b4cd25c --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comments_after_import.ark @@ -0,0 +1 @@ +(import 0000) #00000 diff --git a/tests/fuzzing/corpus-cmin-tmin/comments_after_variable.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comments_after_variable.ark similarity index 65% rename from tests/fuzzing/corpus-cmin-tmin/comments_after_variable.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comments_after_variable.ark index 4d52b3ea1..4a27834e1 100644 --- a/tests/fuzzing/corpus-cmin-tmin/comments_after_variable.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comments_after_variable.ark @@ -1,5 +1,5 @@ (let a 0#00000000000000000000 ) -(mut b 2) #0 +(mut b 2) #00000 (set c 3 #000000 -) #00000 \ No newline at end of file +) #00000 diff --git a/tests/fuzzing/corpus-cmin-tmin/conditions.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_conditions.ark similarity index 85% rename from tests/fuzzing/corpus-cmin-tmin/conditions.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_conditions.ark index 7f6971114..8c2ff0298 100644 --- a/tests/fuzzing/corpus-cmin-tmin/conditions.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_conditions.ark @@ -7,4 +7,4 @@ (fun () (if true 0 1)) (if #00000 true true false) -(if (= 0 2) { (f00) (b00) }) \ No newline at end of file +(if (= 1 2) { (f00) (b00) }) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_del.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_del.ark new file mode 100644 index 000000000..608c34a7b --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_del.ark @@ -0,0 +1,3 @@ +(del a) +(del #00000000 +b) diff --git a/tests/fuzzing/corpus-cmin-tmin/field.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_field.ark similarity index 72% rename from tests/fuzzing/corpus-cmin-tmin/field.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_field.ark index 1cb9aa087..a3159133a 100644 --- a/tests/fuzzing/corpus-cmin-tmin/field.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_field.ark @@ -2,4 +2,4 @@ (f00.cl0000e.na0e #00000 t000.ba0.e00.q00) (f00.cl0000e.na0e t000.ba0.e00.q00) -(f00.cl0000e.na0e t000.ba0.e00.q00 0 2) \ No newline at end of file +(f00.cl0000e.na0e t000.ba0.e00.q00 0 2) diff --git a/tests/fuzzing/corpus-cmin-tmin/functions.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_functions.ark similarity index 89% rename from tests/fuzzing/corpus-cmin-tmin/functions.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_functions.ark index 07027691c..3bd3d12f7 100644 --- a/tests/fuzzing/corpus-cmin-tmin/functions.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_functions.ark @@ -14,6 +14,6 @@ a (#00 a b - #0000 + #00000000 &c) #00000 - {}) \ No newline at end of file + {}) diff --git a/tests/fuzzing/corpus-cmin-tmin/imports.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_imports.ark similarity index 75% rename from tests/fuzzing/corpus-cmin-tmin/imports.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_imports.ark index fdc018e69..f437a857b 100644 --- a/tests/fuzzing/corpus-cmin-tmin/imports.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_imports.ark @@ -1,13 +1,13 @@ (import 000) (import 000.000) -(import 000 :a) +(import 000.000 :a) (import 000.000 :a :b) (import 000.000.000:*) (import#00000000 000) -(import 000.000 #0000 +(import 000.000 #0 :a) (import 000.000 #00000 :a #00000 -:b) \ No newline at end of file +:b) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_macro_cond.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_macro_cond.ark new file mode 100644 index 000000000..c2d72d5a7 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_macro_cond.ark @@ -0,0 +1,2 @@ +($ -0 (a00 f00 ...f0) { + ($if (> (l00 f0) 0) (-> (f00 a00) ...f0) (f00 a00))}) diff --git a/tests/fuzzing/corpus-cmin-tmin/macros2.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_macros.ark similarity index 95% rename from tests/fuzzing/corpus-cmin-tmin/macros2.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_macros.ark index 35cdd2d8d..a5a9ceeff 100644 --- a/tests/fuzzing/corpus-cmin-tmin/macros2.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_macros.ark @@ -3,4 +3,4 @@ ($ de000 (n000 a000 b000) (let n000 (fun a000 b000))) ($ on0 (...a000) (p0000 "00000000000000000000000000000000000000000000000" a000 "0000" (@ a000 0))) ($undef a) -($repr a) \ No newline at end of file +($repr a) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_vars.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_vars.ark new file mode 100644 index 000000000..b6f0be295 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_vars.ark @@ -0,0 +1,8 @@ +(let a +0) +(mut b (if true 3 4)) +(set c { + (let d 5) + (+ 5 d) +}) +(let e (fun (f g) (+ f g))) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_huge_number.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_huge_number.ark new file mode 100644 index 000000000..0a605397f --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_huge_number.ark @@ -0,0 +1 @@ +(let a 1e+0900) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_arguments.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_arguments.ark new file mode 100644 index 000000000..3cf56caa1 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_arguments.ark @@ -0,0 +1 @@ +(fun (a diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_begin.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_begin.ark new file mode 100644 index 000000000..4ea298eb6 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_begin.ark @@ -0,0 +1 @@ +{ a b (let c d) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_call.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_call.ark new file mode 100644 index 000000000..b047f4fb6 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_call.ark @@ -0,0 +1 @@ +(a b c (if (o0 t000) 0 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_del.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_del.ark new file mode 100644 index 000000000..7124b08df --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_del.ark @@ -0,0 +1 @@ +(del) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_fun.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_fun.ark new file mode 100644 index 000000000..f45c56655 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_fun.ark @@ -0,0 +1 @@ +(fun (a b &c)) diff --git a/tests/fuzzing/corpus-cmin-tmin/incomplete_if.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_if.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/incomplete_if.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_if.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_import_1.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_import_1.ark new file mode 100644 index 000000000..477eec265 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_import_1.ark @@ -0,0 +1 @@ +(import) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_import_2.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_import_2.ark new file mode 100644 index 000000000..eccea1a2c --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_import_2.ark @@ -0,0 +1 @@ +(import 0. ) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_let.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_let.ark new file mode 100644 index 000000000..13359f5b5 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_let.ark @@ -0,0 +1,2 @@ +( +let diff --git a/tests/fuzzing/corpus-cmin-tmin/incomplete_list.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_list.ark similarity index 50% rename from tests/fuzzing/corpus-cmin-tmin/incomplete_list.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_list.ark index 7ddec9fb3..710b69794 100644 --- a/tests/fuzzing/corpus-cmin-tmin/incomplete_list.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_list.ark @@ -1,3 +1,3 @@ [ 0 - 0 0 \ No newline at end of file + 0 0 diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_macro.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_macro.ark new file mode 100644 index 000000000..ceb5aaeea --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_macro.ark @@ -0,0 +1 @@ +($ (0)00) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_macro_arguments.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_macro_arguments.ark new file mode 100644 index 000000000..350371dae --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_macro_arguments.ark @@ -0,0 +1 @@ +($ f00 (a diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_macro_spread.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_macro_spread.ark new file mode 100644 index 000000000..d9489654d --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_macro_spread.ark @@ -0,0 +1 @@ +($ f00 (b00 ...)0(000)) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_package_name.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_package_name.ark new file mode 100644 index 000000000..5615f842a --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_package_name.ark @@ -0,0 +1 @@ +(import 0.0. diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_string.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_string.ark new file mode 100644 index 000000000..35ad05b75 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_string.ark @@ -0,0 +1 @@ +(let a "00000) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incorrect_arg_capture.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incorrect_arg_capture.ark new file mode 100644 index 000000000..2abed413a --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incorrect_arg_capture.ark @@ -0,0 +1 @@ +(fun (a &b c)00) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incorrect_import.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incorrect_import.ark new file mode 100644 index 000000000..b74c8b56d --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incorrect_import.ark @@ -0,0 +1 @@ +(import 0.0 :c:*) diff --git a/tests/fuzzing/corpus-cmin-tmin/invalid.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_invalid.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/invalid.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_invalid.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/begin.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_begin.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/begin.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_begin.ark diff --git a/tests/fuzzing/corpus-cmin-tmin/call.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_call.ark similarity index 81% rename from tests/fuzzing/corpus-cmin-tmin/call.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_call.ark index 2ef4dce7b..ff3889d38 100644 --- a/tests/fuzzing/corpus-cmin-tmin/call.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_call.ark @@ -1,6 +1,7 @@ (f000 a b) -(f000#00 -(if 0 2 #0 +( +f000#00 +(if 0 2#0 3) "00000"#0 ) #0 @@ -11,4 +12,4 @@ f00 ) ) -) \ No newline at end of file +) diff --git a/tests/fuzzing/corpus-cmin-tmin/closure.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_closure.ark similarity index 70% rename from tests/fuzzing/corpus-cmin-tmin/closure.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_closure.ark index 81c616095..aba013d68 100644 --- a/tests/fuzzing/corpus-cmin-tmin/closure.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_closure.ark @@ -2,4 +2,4 @@ (fun (&a #00 &b) 0) (fun (a &b) 0) -(fun (a b &c &d) 0) \ No newline at end of file +(fun (a b &c &d) 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/comments.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_comments.ark similarity index 79% rename from tests/fuzzing/corpus-cmin-tmin/comments.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_comments.ark index c9465fb1c..7124f4ac9 100644 --- a/tests/fuzzing/corpus-cmin-tmin/comments.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_comments.ark @@ -4,4 +4,4 @@ #00 -#000000 \ No newline at end of file +#000000 diff --git a/tests/fuzzing/corpus-cmin-tmin/del.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_del.ark similarity index 77% rename from tests/fuzzing/corpus-cmin-tmin/del.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_del.ark index 2d9cff10d..c91816af9 100644 --- a/tests/fuzzing/corpus-cmin-tmin/del.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_del.ark @@ -1,7 +1,8 @@ (del a) ( - del b) + del b +) ( del #00 @@ -11,4 +12,4 @@ (#0 del d #00 -) \ No newline at end of file +) diff --git a/tests/fuzzing/corpus-cmin-tmin/fields.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_fields.ark similarity index 65% rename from tests/fuzzing/corpus-cmin-tmin/fields.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_fields.ark index 960d4f242..a4737ca7a 100644 --- a/tests/fuzzing/corpus-cmin-tmin/fields.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_fields.ark @@ -1,7 +1,7 @@ (let a b.c) (mut d e.f.g) (if (#0000 - h0.j0) l.m n.o.p) + h0.j0)l.m n.o.p) (while q.r s.t) (fun () u.v) -(begin x.y.z) \ No newline at end of file +(begin x.y.z) diff --git a/tests/fuzzing/corpus-cmin-tmin/fun.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_fun.ark similarity index 98% rename from tests/fuzzing/corpus-cmin-tmin/fun.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_fun.ark index f606b50eb..e8521da72 100644 --- a/tests/fuzzing/corpus-cmin-tmin/fun.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_fun.ark @@ -24,4 +24,4 @@ d000 (fun () ()) (fun (a) ( #00000 -)) \ No newline at end of file +)) diff --git a/tests/fuzzing/corpus-cmin-tmin/if.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_if.ark similarity index 77% rename from tests/fuzzing/corpus-cmin-tmin/if.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_if.ark index c702865a2..3a51bc029 100644 --- a/tests/fuzzing/corpus-cmin-tmin/if.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_if.ark @@ -4,7 +4,7 @@ 2 3) ( if #00 - "0" #0 + "0" #0 0 #00 #00 @@ -15,4 +15,4 @@ (if 3 ()) (if (f000 a b) a b) -(if (a b c) (d e) (f)) \ No newline at end of file +(if (a b c) (d e) (f)) diff --git a/tests/fuzzing/corpus-cmin-tmin/import.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_import.ark similarity index 95% rename from tests/fuzzing/corpus-cmin-tmin/import.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_import.ark index 12b7339ac..09965b2f1 100644 --- a/tests/fuzzing/corpus-cmin-tmin/import.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_import.ark @@ -2,7 +2,7 @@ (import 0.0) ( import #00000000 -#0000000 +#00000000 000.000.000 #000000000000 #000000000000000 ) @@ -13,4 +13,4 @@ import #00000000 (import 000.000 #0000000000000 :a #00000000000000 :b#00000000000000000000000 -) \ No newline at end of file +) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_let_atom.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_let_atom.ark new file mode 100644 index 000000000..badeea126 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_let_atom.ark @@ -0,0 +1,21 @@ +(let a000000 10) +( + mut b 13) + ( +set c "") + +#00000000000 +#0000000000 +( +let +b #0000000000 +"00"#00000 +) + +(let d (if 1 0 3)) +(let e +( +while #0000000 +4 +5 +)) diff --git a/tests/fuzzing/corpus-cmin-tmin/list.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_list.ark similarity index 78% rename from tests/fuzzing/corpus-cmin-tmin/list.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_list.ark index 0920c179c..82914a73a 100644 --- a/tests/fuzzing/corpus-cmin-tmin/list.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_list.ark @@ -1,9 +1,9 @@ (list 1 2 3) (list) (list (list 1)) -[]#000 +[]#0000 [#0000000 1 #000 ] -[[1 a]] \ No newline at end of file +[[1 a]] diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_loop.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_loop.ark new file mode 100644 index 000000000..1dc6bec89 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_loop.ark @@ -0,0 +1,14 @@ +# +(while 0 0) +( +while +2 +2#000 +) + + + +( #0000 + #0000 + while 3 3 ) +(while (is0000 0) (d000000 a (if b c d))) diff --git a/tests/fuzzing/corpus-cmin-tmin/macro.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_macro.ark similarity index 93% rename from tests/fuzzing/corpus-cmin-tmin/macro.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_macro.ark index f1c65cb63..3bde7cca0 100644 --- a/tests/fuzzing/corpus-cmin-tmin/macro.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_macro.ark @@ -15,4 +15,4 @@ e ($ k (l ...m) (p0000 l m)) ($ n ( ...p -) (p0000 p)) \ No newline at end of file +) (p0000 p)) diff --git a/tests/fuzzing/corpus-cmin-tmin/numbers.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_numbers.ark similarity index 65% rename from tests/fuzzing/corpus-cmin-tmin/numbers.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_numbers.ark index 9cdd271af..8883e6a3f 100644 --- a/tests/fuzzing/corpus-cmin-tmin/numbers.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_numbers.ark @@ -3,5 +3,5 @@ (let c -0) (let d 1e0) (let e 2e8) -(let f 4e00) -(let g 0.01e00) \ No newline at end of file +(let f 4e-00) +(let g 0.01e-00) diff --git a/tests/fuzzing/corpus-cmin-tmin/strings.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_strings.ark similarity index 53% rename from tests/fuzzing/corpus-cmin-tmin/strings.ark rename to tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_strings.ark index a0817e684..2943c097f 100644 --- a/tests/fuzzing/corpus-cmin-tmin/strings.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_strings.ark @@ -1,2 +1,2 @@ (print "000" "000\"0000") -(print "\\00000000") \ No newline at end of file +(print "\\00000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/too_many_args_callable.ark b/tests/fuzzing/corpus-cmin-tmin/too_many_args_callable.ark deleted file mode 100644 index 8a514ab17..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/too_many_args_callable.ark +++ /dev/null @@ -1,2 +0,0 @@ -(let f00(fun(a b) (+ a b))) -(f00 0 2 3) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/unbound_capture.ark b/tests/fuzzing/corpus-cmin-tmin/unbound_capture.ark deleted file mode 100644 index 71de9f029..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/unbound_capture.ark +++ /dev/null @@ -1 +0,0 @@ -(mut d (fun (&d) (print d))) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/utf8.ark b/tests/fuzzing/corpus-cmin-tmin/utf8.ark deleted file mode 100644 index 175e3d696..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/utf8.ark +++ /dev/null @@ -1,28 +0,0 @@ -(let foo(fun (a b) ())) -(let bar (fun (a) ())) - -(let ---> 10) -(foo ---> 10) - -(let <-- 16) -(foo <-- 10) -(bar (< ---> <--)) - -(let emotes [ - "000" "00" "00" "👿" "00" "00" - "00" "00" "00" "00" "00" "00" - "00" "00" "00" "00" "0"]) -(mut i 0) -(while (< i (len emotes)) { - (foo (len (@ emotes i)) 4) - (set i (+ 1 i)) }) - -(foo "\U0001f47f" "👿") -(foo "\U0001F47F" "👿") -(foo "\u1e0b" "ḋ") -(foo "\u1E0B" "ḋ") - -(foo (str:ord "👺") 100100) -(foo (str:chr 100100) "👺") -(foo (str:ord "0") 36) -(foo (str:chr 36) "0") diff --git a/tests/fuzzing/corpus-cmin-tmin/vars.ark b/tests/fuzzing/corpus-cmin-tmin/vars.ark deleted file mode 100644 index 1f6e1dd51..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/vars.ark +++ /dev/null @@ -1,6 +0,0 @@ -(let a -0)(mut b(if true 3 4))(set c{ - (let d 5) - (+ 5d) -}) -(let e (fun (f g) (+ f g))) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/well_formed_args.ark b/tests/fuzzing/corpus-cmin-tmin/well_formed_args.ark deleted file mode 100644 index d633a4378..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/well_formed_args.ark +++ /dev/null @@ -1,2 +0,0 @@ -($ defun (let n0000(fun a000 y))) -(defun f000(a b) (+ a b)) diff --git a/tests/fuzzing/corpus-cmin/async_test.ark b/tests/fuzzing/corpus-cmin/async_test.ark deleted file mode 100644 index cf8540394..000000000 --- a/tests/fuzzing/corpus-cmin/async_test.ark +++ /dev/null @@ -1,29 +0,0 @@ -(import std.List) - -(let foo (fun (a b) (+ a b))) -(let async-foo (async foo 1 2)) - -(let size 1000) -(let data (list:fill size 1)) - -(let sum (fun (a b src) { - (mut acc 0) - (while (< a b) { - (set acc (+ acc (@ src a))) - (set a (+ 1 a))}) - acc })) - -(print (type async-foo) "UserType") -(print (await async-foo) 3) -(let start-non-async (time)) -(let res-non-async (sum 0 size data)) -(let time-non-async (- (time) start-non-async)) -(let start-async (time)) -(let workers [ - (async sum 0 (/ size 4) data) - (async sum (/ size 4) (/ size 2) data) - (async sum (/ size 2) (- size (/ size 4)) data) - (async sum (- size (/ size 4)) size data)]) -(let res-async (list:reduce (list:map workers (fun (w) (await w))) (fun (a b) (+ a b)))) -(let time-async (- (time) start-async)) -(print time-async) diff --git a/tests/fuzzing/corpus-cmin/builtins-list.ark b/tests/fuzzing/corpus-cmin/builtins-list.ark deleted file mode 100644 index 09da39f07..000000000 --- a/tests/fuzzing/corpus-cmin/builtins-list.ark +++ /dev/null @@ -1,20 +0,0 @@ -(let base-list [1 2 3]) -(let base-list-enhanced (concat base-list [4 5])) - -(let foo (fun (a b) ())) - -(foo (append (append base-list 4) 5) base-list-enhanced) -(foo (concat base-list [4 5]) base-list-enhanced) -(foo (type []) "List") -(foo (list:reverse base-list) [3 2 1]) -(foo (list:reverse []) []) -(foo (list:find [] nil) -1) -(foo (list:find [12] 12) 0) -(foo (list:find [1 2 3] 2) 1) -(foo (list:find [12] nil) -1) -(foo (list:slice base-list-enhanced 0 3 1) base-list) -(foo (list:slice base-list-enhanced 0 1 1) [1]) -(foo (list:slice base-list-enhanced 0 3 2) [1 3]) -(foo (list:sort [5 4 3 2 1]) [1 2 3 4 5]) -(foo (list:sort [5]) [5]) -(foo (list:sort []) []) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/builtins-str.ark b/tests/fuzzing/corpus-cmin/builtins-str.ark deleted file mode 100644 index 3366d6aa9..000000000 --- a/tests/fuzzing/corpus-cmin/builtins-str.ark +++ /dev/null @@ -1,10 +0,0 @@ -(let foo (fun (a b) ())) - -(foo (str:find "abc" "d") -1) -(foo (str:find "abc" "a") 0) -(foo (str:find "abc" "bc") 1) -(foo (str:find "abcdefghijkl" "defijkl") -1) -(foo (str:find "abcdefghijkl" "defghijkl") 3) -(foo (str:removeAt "abcdefghijkl" 3) "abcefghijkl") -(foo (str:removeAt "abcdefghijkl" 0) "bcdefghijkl") -(foo (str:removeAt "abcdefghijkl" 11) "abcdefghijk") \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/closures2.ark b/tests/fuzzing/corpus-cmin/closures2.ark deleted file mode 100644 index fb961813d..000000000 --- a/tests/fuzzing/corpus-cmin/closures2.ark +++ /dev/null @@ -1,15 +0,0 @@ -# Another example to simulate a python range(x, y) - -# this function will return a closure capturing the number given -# and modifying its value each time we'll call the closure, returning -# the new number -(let countdown-from (fun (number) - (fun (&number) { - (set number (- number 1)) - number }))) - -(let countdown-from-3 (countdown-from 3)) - -(print "Countdown " (countdown-from-3)) # 2 -(print "Countdown " (countdown-from-3)) # 1 -(print "Countdown " (countdown-from-3)) # 0 diff --git a/tests/fuzzing/corpus-cmin/comments_after_import.ark b/tests/fuzzing/corpus-cmin/comments_after_import.ark deleted file mode 100644 index 1de571d8b..000000000 --- a/tests/fuzzing/corpus-cmin/comments_after_import.ark +++ /dev/null @@ -1 +0,0 @@ -(import test) # test \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/comments_after_while.ark b/tests/fuzzing/corpus-cmin/comments_after_while.ark deleted file mode 100644 index 04f9830a8..000000000 --- a/tests/fuzzing/corpus-cmin/comments_after_while.ark +++ /dev/null @@ -1,7 +0,0 @@ -(while false # cond - 1 # body - ) - - -(while false {} # no body -) # infinite loop \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/examples_blockchain.ark b/tests/fuzzing/corpus-cmin/examples_blockchain.ark new file mode 100644 index 000000000..04af95fe5 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/examples_blockchain.ark @@ -0,0 +1,168 @@ +(import std.hash) +(import std.http) +(import std.json) + +(import std.Range) +(import std.List) + +# define what an ArkCoin block is +(let make:block (fun (index timestamp data previous_hash) { + (let hash (hash:sha256 (+ (toString index) (toString (math:floor timestamp)) (json:toString data) previous_hash))) + (print "made block " hash) + (fun (&index ×tamp &data &previous_hash &hash) ())})) + +(let make:block:fromJSON (fun (data) + (make:block (json:get data "index") + (json:get data "timestamp") + (json:get data "data") + (json:get data "hash")))) + +# generate genesis block +(let make:genesis_block (fun () + (make:block 0 (time) (json:fromList [ + "type" "Genesis block" + "proof-of-work" 1 + ]) "deadbeef"))) + +# let the user add their miner address if we can't find it +(let miner_address (if (not (io:fileExists? "miner.address")) + (input "miner address> ") + (io:readFile "miner.address"))) +(io:writeFile "miner.address" miner_address) +# this node's blockchain copy +(mut blockchain (list (make:genesis_block))) +# storing the transactions that this node has +(mut nodes_transactions []) +# storing the url data of every other node in the network so we can talk with them +(mut peer_nodes []) +# magic number for the proof of work +(let magic 12) + +(let find_new_chains (fun () { + (print "finding new chains") + + # get the blockchains of every other node + (mut other_chains []) + (list:forEach peer_nodes (fun (url) { + (let cli (http:client:create url 80)) + (let tmp (http:client:get cli "/")) + (if (not (nil? tmp)) + { + (let content (make:block:fromJSON (json:fromString (@ tmp 1)))) + (set other_chains (append other_chains content))}) + (del cli)})) + other_chains })) + +(let verify_proof_of_work (fun (proof last_proof) + (and (> proof last_proof) (= 0 (mod proof magic)) (= 0 (mod proof last_proof))))) + +(let verify_chain (fun (chain) { + (print "verifying chain") + + (mut previous nil) + (mut ok? true) + (list:forEach chain (fun (block) { + # no need to continue checking the blocks if a block wasn't ok + (if (and ok? (not (nil? previous))) + (set ok? (verify_proof_of_work (json:get block.data "proof-of-work") (json:get previous.data "proof-of-work")))) + (set previous block)})) + ok? })) + +(let consensus (fun () { + (print "consensus running") + + (let other_chains (find_new_chains)) + # if our chain isn't longest, then we store the longest + (list:forEach other_chains (fun (chain) { + (if (and (< (len blockchain) (len chain)) (verify_chain chain)) + (set blockchain chain))}))})) + +(let proof_of_work (fun (last_proof) { + (print "proof of work being generated") + + (mut inc (+ 1 last_proof)) + # keep incrementing until it's equal to a number divisible by 12 and + # the proof of work of the previous block in the chain + (while (not (and (= 0 (mod inc magic))) (= 0 (mod inc last_proof))) + (set inc (+ 1 inc))) + inc })) + +(let srv (http:server:create)) +(http:server:post srv "/transaction" (fun (request) { + (print "posting block " request) + + # on each post request, extract transaction data + (let new (json:fromString request)) + (set nodes_transactions (append nodes_transactions new)) + (print "New transaction") + (print (str:format "FROM: {}" (json:get new "from"))) + (print (str:format "TO: {}" (json:get new "to"))) + (print (str:format "AMOUNT: {}" (json:get new "amount"))) + + # return value + [200 "transaction submission successful" "text/plain"]})) + +(http:server:get srv "/blocks" (fun (_) { + (print "fetching blocks") + + (consensus) + (mut to_send []) + (list:forEach blockchain (fun (data) { + (set to_send (append to_send (json:fromList [ + "index" data.index + "timestamp" data.timestamp + "data" data.data + "hash" data.hash])))})) + + (mut str (toString (@ to_send 0))) + (list:forEach (tail to_send) (fun (e) + (set str (+ str ", " (toString e))))) + + [200 (+ "{\"chain\": [" str "]}") "application/json"]})) + +(http:server:get srv "/mine" (fun (data) { + (print "mining block") + (print (type data)) + (if (not (nil? data)) + (print (http:params:toList data))) + (set data "") + + (let last_block (@ blockchain -1)) + (let last_proof (json:get last_block.data "proof-of-work")) + # find the proof of work for the current block being mined + # the program will hang here until a new proof of work is found + (let proof (proof_of_work last_proof)) + # once we have the proof of work, we can mine a block so we reward the miner by adding a transaction + (set nodes_transactions (append nodes_transactions (json:fromList + [ + "from" "network" + "to" miner_address + "amount" 1]))) + (print "make block") + # gather the data needed to create a new block + (mut new_block (make:block + (+ 1 last_block.index) + (time) + (json:fromList + [ + "proof-of-work" proof + "transactions" nodes_transactions + "content" data ]) + last_block.hash)) + + (set blockchain (append blockchain new_block)) + # empty transactions list + (set nodes_transactions []) + + [ + 200 + (+ "{" + "\"index\": " (toString new_block.index) "," + "\"timestamp\": " (toString new_block.timestamp) "," + "\"data\": " (toString new_block.data) "," + "\"hash\": \"" (toString new_block.hash) "\"" + "}") + "application/json"]})) + +(print "Listening on localhost:80 for miner " miner_address) +(http:server:listen srv "localhost" 80) diff --git a/tests/fuzzing/corpus-cmin/callbacks.ark b/tests/fuzzing/corpus-cmin/examples_callbacks.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/callbacks.ark rename to tests/fuzzing/corpus-cmin/examples_callbacks.ark diff --git a/tests/fuzzing/corpus-cmin/collatz.ark b/tests/fuzzing/corpus-cmin/examples_collatz.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/collatz.ark rename to tests/fuzzing/corpus-cmin/examples_collatz.ark diff --git a/tests/fuzzing/corpus-cmin/fibo.ark b/tests/fuzzing/corpus-cmin/examples_fibo.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/fibo.ark rename to tests/fuzzing/corpus-cmin/examples_fibo.ark diff --git a/tests/fuzzing/corpus-cmin/examples_games_game_of_life.ark b/tests/fuzzing/corpus-cmin/examples_games_game_of_life.ark new file mode 100644 index 000000000..c623b8750 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/examples_games_game_of_life.ark @@ -0,0 +1,69 @@ +(let board [ + 0 0 0 0 + 0 1 1 1 + 1 1 1 0 + 0 0 0 0]) +(let width 4) +(let height 4) +(let dead 0) +(let alive 1) + +(let get (fun (board_ i width height) + (if (and (>= i 0) (< i (* width height))) + (@ board_ i) + dead ))) + +(let neigh (fun (board_ index width height) { + (let x (math:floor (mod index width))) + (let y (math:floor (/ index width))) + (mut count 0) + + (if (>= (- y 1) 0) + (set count (+ count (get board_ (- index width) width height)))) + (if (< (+ y 1) height) + (set count (+ count (get board_ (+ index width) width height)))) + (if (>= (- x 1) 0) + (set count (+ count (get board_ (- index 1) width height)))) + (if (< (+ x 1) width) + (set count (+ count (get board_ (+ index 1) width height)))) + + (if (and (>= (- x 1) 0) (>= (- y 1) 0)) + (set count (+ count (get board_ (- index 1 width) width height)))) + (if (and (< (+ x 1) width) (< (+ y 1) height)) + (set count (+ count (get board_ (+ index width 1) width height)))) + (if (and (>= (- x 1) 0) (< (+ y 1) height)) + (set count (+ count (get board_ (+ index width -1) width height)))) + (if (and (< (+ x 1) width) (>= (- y 1) 0)) + (set count (+ count (get board_ (- index width -1) width height)))) + + count })) + +(mut copy (list:fill (* height width) dead)) +(mut i 0) +(while (< i (* width height)) { + (mut neighs (neigh board i width height)) + (if (= 3 neighs) + (set copy (list:setAt copy i alive))) + (if (= 2 neighs) + (set copy (list:setAt copy i (@ board i)))) + (if (or (< neighs 2) (> neighs 3)) + (set copy (list:setAt copy i dead))) + + (set i (+ 1 i)) }) + +(let display (fun (board width height) { + (mut i 0) + (while (< i (* width height)) { + (mut y (math:floor (/ i width))) + (mut x (math:floor (mod i width))) + + (if (= 0 x) (puts "\n")) + (if (= alive (@ board i)) (puts "x") (puts " ")) + + (set i (+ 1 i)) }) + (puts "\n") })) + +(print "initial board:") +(display board width height) +(print "new board:") +(display copy width height) diff --git a/tests/fuzzing/corpus-cmin/examples_games_snake_snake.ark b/tests/fuzzing/corpus-cmin/examples_games_snake_snake.ark new file mode 100644 index 000000000..44c593ac7 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/examples_games_snake_snake.ark @@ -0,0 +1,208 @@ +(import std.sf") +(import std.Exceptions) +(import std.Switch) + +(sf:window:init 600 600 "ArkSnake") +(sf:window:setFPS 60) + +# stuff needed for the texts +(let font (sf:load:font "FreeSansBold.ttf")) +(let fps_text (sf:text:make font "FPS: NaN" 18 [255 255 255])) +(sf:set:pos fps_text (/ (- 600 (sf:width fps_text)) 2) 580) + +# the board object +# 0 => empty, 1 => apple +(let create-board-object (fun () { + # sprites used for the game + (let apple_texture (sf:load:texture "apple.png")) + (let apple_sprite (sf:load:sprite apple_texture)) + + (mut data []) + { + (mut _y 0) + + (while (!= _y 20) { + (mut _x 0) + (mut line []) + + (while (!= _x 20) { + (mut t 0) # empty + (if (or (and (= _y 10) (= _x 5)) (or (and (= _y 5) (= _x 2)) (and (= _y 12) (= _x 12)))) + (set t 1) + (set t 0)) + (set line (append line t)) + (set _x (+ 1 _x)) + }) + + (set data (append data line)) + (set _y (+ 1 _y)) + }) + } + + (let draw_board (fun () { + (mut y 0) + (while (!= y 20) { + (mut x 0) + (while (!= x 20) { + (mut case (@ (@ data y) x)) + (if (= case 1) + { + (sf:set:pos apple_sprite (* 20 x) (* 20 y)) + (sf:draw apple_sprite) + }) + (set x (+ x 1)) + }) + (set y (+ 1 y)) + }) + + # ret + nil + })) + + (let has_apple_left? (fun () { + (mut apple_left 0) + (mut y 0) + (while (!= y 20) { + (mut x 0) + (while (!= x 20) { + (mut case (@ (@ data y) x)) + (if (= case 1) + (set apple_left (+ 1 apple_left))) + (set x (+ x 1)) + }) + (set y (+ 1 y)) + }) + + # ret + apple_left + })) + + (let eat_apple_at (fun (x y) + (if (and (and (>= x 0) (>= y 0)) (and (< y 20) (< x 20))) + { + (let test (= 1 (@ (@ data y) x))) + (if test + # remove apple + { + (mut _y 0) + (mut _data []) + + (while (!= _y 20) { + (mut _x 0) + (mut line []) + + (if (= _y y) + (while (!= _x 20) { + (mut case (@ (@ data _y) _x)) + (if (= _x x) (set case 0) ()) + (set line (append line case)) + (set _x (+ 1 _x)) + }) + (set line (@ data _y))) + + (set _data (append _data line)) + (set _y (+ 1 _y)) + }) + + (set data _data) + } + ()) + (return test) + } + (throw "Out of bounds")) + )) + + (fun (&data &apple_sprite &draw_board &has_apple_left? &eat_apple_at) ()) +})) + +# instanciating +(let board (create-board-object)) + +# the snake +(let create-snake-object (fun () { + (mut pos [[0 0]]) + (mut should_move true) + (mut last_direction [1 0]) # right + (let snake_texture (sf:load:texture "snake.png")) + (let snake_sprite (sf:load:sprite snake_texture)) + + (let move (fun (mx my board) { + # we don't need to move since this function was called explicitly + (set should_move false) + (set last_direction [mx my]) + + (let p (@ pos (- (len pos) 1))) + + (try (board.eat_apple_at (+ mx (@ p 0)) (+ my (@ p 1))) + (fun (result) { + # if result == false, move the tail to the head + # otherwise, add a new head + (set pos (append pos [(+ mx (@ p 0)) (+ my (@ p 1))])) + (if (not result) + (if (!= 0 (len pos)) + # then + (set pos (tail pos)))) + }) + (fun (err) ())) + })) + + (let reset_auto_move (fun () (set should_move true))) + + (let auto_move (fun (board) { + (move (@ last_direction 0) (@ last_direction 1) board)})) + + (let draw (fun () { + (mut acc 0) + (while (!= acc (len pos)) { + (mut current (@ pos acc)) + (sf:set:pos snake_sprite (* 20 (@ current 0)) (* 20 (@ current 1))) + (sf:draw snake_sprite) + (set acc (+ 1 acc)) + }) + })) + + (fun (&move &reset_auto_move &auto_move &draw &pos &should_move &last_direction &snake_sprite) ()) +})) + +# instanciating +(let snake (create-snake-object)) +(mut frame 0) + +(while (sf:window:open?) { + (mut frame_start (time)) + + # event handling + (snake.reset_auto_move) + (mut event (sf:pollEvent)) + + (switch event [ + [(sf:event "quit") (fun () (sf:window:close))] + [(sf:event "keyup" "up") (fun () (snake.move 0 -1 board))] + [(sf:event "keyup" "down") (fun () (snake.move 0 1 board))] + [(sf:event "keyup" "right") (fun () (snake.move 1 0 board))] + [(sf:event "keyup" "left") (fun () (snake.move -1 0 board))] + ]) + + # update + (if (= 0 (board.has_apple_left?)) + { + (print "you win!") + (sf:window:close) + }) + + (if (= 0 (mod frame 20)) + (snake.auto_move board)) + (set frame (+ 1 frame)) + + # rendering + (sf:window:clear 0 0 0) + (board.draw_board) # draw board first + (snake.draw) # then snake + (sf:draw fps_text) + (sf:window:display) # double buffering + + (mut diff (- (time) frame_start)) + (if (!= diff 0) + (sf:text:set fps_text (+ "FPS: " (toString (/ 1 diff)))) + (sf:text:set fps_text "FPS: NaN")) +}) diff --git a/tests/fuzzing/corpus-cmin/examples_http.ark b/tests/fuzzing/corpus-cmin/examples_http.ark new file mode 100644 index 000000000..93051300c --- /dev/null +++ b/tests/fuzzing/corpus-cmin/examples_http.ark @@ -0,0 +1,52 @@ +# here we import the http module of the standard library +(import std.http) + +# a toggle to try the client and the server +(let server false) + +(if server + # then, server + { + # we can have only 1 server at a time + (let srv (http:server:create)) + # the handler answering requests on a given route, here /hi + (let f (fun (data) { + [ + 200 + (if (nil? data) + "hello world" + (+ "hello, " (toString (http:params:toList data)))) + "text/plain" + ]})) + # configure the route and the handler, we can also give a string instead of a function + (http:server:get srv "/hi" f) + (print "starting on localhost:80") + # make the server listen forever on the port 80 + (http:server:listen srv "localhost" 80)} + # else, client + { + # we give the website and the port + (let cli (http:client:create "monip.org" 80)) + + # we get a route on a given client + (mut output (http:client:get cli "/")) + # if we got nil, then we couldn't reach the destination + (if (nil? output) + (print "couldn't reach the server") + (print output)) + + # we can create multiple clients at the same time + (let cli2 (http:client:create "yahoo.com" 80)) + + (set output (http:client:get cli2 "/")) + # the function returns a list: [code content] + (print (@ output 0)) # status: 301 + + # follow redirections + (http:client:setFollowLocation cli2 true) + # and retry + (set output (http:client:get cli2 "/")) + # it should work now + (if (nil? output) + (print "error") + (print (@ output 0)))}) # status: 200 diff --git a/tests/fuzzing/corpus-cmin/examples_more-or-less.ark b/tests/fuzzing/corpus-cmin/examples_more-or-less.ark new file mode 100644 index 000000000..465c238df --- /dev/null +++ b/tests/fuzzing/corpus-cmin/examples_more-or-less.ark @@ -0,0 +1,25 @@ +(import std.random) +(import std.Math) + +(let number (mod (math:abs (random)) 10000)) + +(let game (fun () { + (let impl (fun (tries) { + (let guess (toNumber (input "Input a numeric value: "))) + + (if (< guess number) + { + (print "It's more than " guess) + (impl (+ tries 1))} + (if (= guess number) + { + (print "You found it!") + tries } + { + (print "It's less than " guess) + (impl (+ tries 1))}))})) + + (let tries (impl 0)) + (print "You won in " tries " tries.")})) + +(game) diff --git a/tests/fuzzing/corpus-cmin/quicksort.ark b/tests/fuzzing/corpus-cmin/examples_quicksort.ark similarity index 92% rename from tests/fuzzing/corpus-cmin/quicksort.ark rename to tests/fuzzing/corpus-cmin/examples_quicksort.ark index cce3f7ea0..9eedab708 100644 --- a/tests/fuzzing/corpus-cmin/quicksort.ark +++ b/tests/fuzzing/corpus-cmin/examples_quicksort.ark @@ -35,8 +35,14 @@ # obviously ArkScript will be a bit slower (let bench (fun (name code) { (mut start (time)) - (code) - (let t (* 1000 (- (time) start))) + (let rep 1) + + (mut i 0) + (while (< i rep) { + (code) + (set i (+ 1 i))}) + + (let t (/ (* 1000 (- (time) start)) rep)) (print name " average: " t "ms") t })) diff --git a/tests/fuzzing/corpus-cmin/sum_digits.ark b/tests/fuzzing/corpus-cmin/examples_sum_digits.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/sum_digits.ark rename to tests/fuzzing/corpus-cmin/examples_sum_digits.ark diff --git a/tests/fuzzing/corpus-cmin/huge_number.ark b/tests/fuzzing/corpus-cmin/huge_number.ark deleted file mode 100644 index 337d58921..000000000 --- a/tests/fuzzing/corpus-cmin/huge_number.ark +++ /dev/null @@ -1 +0,0 @@ -(let a 1e+4932) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/incomplete_arguments.ark b/tests/fuzzing/corpus-cmin/incomplete_arguments.ark deleted file mode 100644 index 0ccca6130..000000000 --- a/tests/fuzzing/corpus-cmin/incomplete_arguments.ark +++ /dev/null @@ -1 +0,0 @@ -(fun (a \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/incomplete_begin.ark b/tests/fuzzing/corpus-cmin/incomplete_begin.ark deleted file mode 100644 index 46ba98069..000000000 --- a/tests/fuzzing/corpus-cmin/incomplete_begin.ark +++ /dev/null @@ -1 +0,0 @@ -{ a b (let c d) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/incomplete_call.ark b/tests/fuzzing/corpus-cmin/incomplete_call.ark deleted file mode 100644 index 3456820e9..000000000 --- a/tests/fuzzing/corpus-cmin/incomplete_call.ark +++ /dev/null @@ -1 +0,0 @@ -(a b c (if (ok true) 1 2) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/incomplete_del.ark b/tests/fuzzing/corpus-cmin/incomplete_del.ark deleted file mode 100644 index f9748e69c..000000000 --- a/tests/fuzzing/corpus-cmin/incomplete_del.ark +++ /dev/null @@ -1 +0,0 @@ -(del) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/incomplete_fun.ark b/tests/fuzzing/corpus-cmin/incomplete_fun.ark deleted file mode 100644 index aa9983dd8..000000000 --- a/tests/fuzzing/corpus-cmin/incomplete_fun.ark +++ /dev/null @@ -1 +0,0 @@ -(fun (a b &c)) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/incomplete_import_1.ark b/tests/fuzzing/corpus-cmin/incomplete_import_1.ark deleted file mode 100644 index 802f85ecf..000000000 --- a/tests/fuzzing/corpus-cmin/incomplete_import_1.ark +++ /dev/null @@ -1 +0,0 @@ -(import) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/incomplete_import_2.ark b/tests/fuzzing/corpus-cmin/incomplete_import_2.ark deleted file mode 100644 index abe834157..000000000 --- a/tests/fuzzing/corpus-cmin/incomplete_import_2.ark +++ /dev/null @@ -1 +0,0 @@ -(import a. ) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/incomplete_let.ark b/tests/fuzzing/corpus-cmin/incomplete_let.ark deleted file mode 100644 index a5ea45479..000000000 --- a/tests/fuzzing/corpus-cmin/incomplete_let.ark +++ /dev/null @@ -1,2 +0,0 @@ -( -let \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/incomplete_macro.ark b/tests/fuzzing/corpus-cmin/incomplete_macro.ark deleted file mode 100644 index d5fa0be09..000000000 --- a/tests/fuzzing/corpus-cmin/incomplete_macro.ark +++ /dev/null @@ -1 +0,0 @@ -($ (a) a) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/incomplete_macro_arguments.ark b/tests/fuzzing/corpus-cmin/incomplete_macro_arguments.ark deleted file mode 100644 index b2a8b4117..000000000 --- a/tests/fuzzing/corpus-cmin/incomplete_macro_arguments.ark +++ /dev/null @@ -1 +0,0 @@ -($ foo (a \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/incomplete_macro_spread.ark b/tests/fuzzing/corpus-cmin/incomplete_macro_spread.ark deleted file mode 100644 index 43e48c81b..000000000 --- a/tests/fuzzing/corpus-cmin/incomplete_macro_spread.ark +++ /dev/null @@ -1 +0,0 @@ -($ foo (bar ...) (bar)) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/incomplete_package_name.ark b/tests/fuzzing/corpus-cmin/incomplete_package_name.ark deleted file mode 100644 index 9cd2b6fa4..000000000 --- a/tests/fuzzing/corpus-cmin/incomplete_package_name.ark +++ /dev/null @@ -1 +0,0 @@ -(import a.b. \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/incomplete_string.ark b/tests/fuzzing/corpus-cmin/incomplete_string.ark deleted file mode 100644 index b486e33c2..000000000 --- a/tests/fuzzing/corpus-cmin/incomplete_string.ark +++ /dev/null @@ -1 +0,0 @@ -(let a "1 2 3) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/incorrect_arg_capture.ark b/tests/fuzzing/corpus-cmin/incorrect_arg_capture.ark deleted file mode 100644 index 363224f8a..000000000 --- a/tests/fuzzing/corpus-cmin/incorrect_arg_capture.ark +++ /dev/null @@ -1 +0,0 @@ -(fun (a &b c) 1) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/incorrect_escape_seq.ark b/tests/fuzzing/corpus-cmin/incorrect_escape_seq.ark deleted file mode 100644 index 179f7d04b..000000000 --- a/tests/fuzzing/corpus-cmin/incorrect_escape_seq.ark +++ /dev/null @@ -1 +0,0 @@ -(print "\i bla bla bla") \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/incorrect_import.ark b/tests/fuzzing/corpus-cmin/incorrect_import.ark deleted file mode 100644 index 4835b642d..000000000 --- a/tests/fuzzing/corpus-cmin/incorrect_import.ark +++ /dev/null @@ -1 +0,0 @@ -(import a.b :c:*) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/list1.ark b/tests/fuzzing/corpus-cmin/list1.ark deleted file mode 100644 index 02a0961b5..000000000 --- a/tests/fuzzing/corpus-cmin/list1.ark +++ /dev/null @@ -1,21 +0,0 @@ -(let a [1 2 3]) -(let b [4 5 6]) - -(let bar (fun (a b) ())) - -(let make (fun (a b) - (fun (&a &b) ()))) -(let foo (make "hello" 1)) - -(bar ["hello" 1] [foo.a foo.b]) -(bar 2 (len [foo.a foo.b])) -(bar ["hello"] (append [] foo.a)) - -(bar (append a 4) [1 2 3 4]) -(bar a [1 2 3]) -(bar (append a a) [1 2 3 [1 2 3]]) -(bar a [1 2 3]) - -(bar (concat a b) [1 2 3 4 5 6]) -(bar a [1 2 3]) -(bar b [4 5 6]) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/list2.ark b/tests/fuzzing/corpus-cmin/list2.ark deleted file mode 100644 index 9243f9ef1..000000000 --- a/tests/fuzzing/corpus-cmin/list2.ark +++ /dev/null @@ -1,17 +0,0 @@ -(let a [1 2 3]) -(let b [4 5 6]) - -(let bar (fun (a b) ())) - -(let make (fun (a b) - (fun (&a &b) ()))) -(let foo (make "hello" 1)) - -(bar (pop a 0) [2 3]) -(bar (pop a 1) [1 3]) -(bar (pop a 2) [1 2]) -(bar a [1 2 3]) - -(bar (list:reverse a) [3 2 1]) -(bar a [1 2 3]) -(bar (list:reverse []) []) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/list3.ark b/tests/fuzzing/corpus-cmin/list3.ark deleted file mode 100644 index cdace7205..000000000 --- a/tests/fuzzing/corpus-cmin/list3.ark +++ /dev/null @@ -1,19 +0,0 @@ -(let a [1 2 3]) -(let b [4 5 6]) - -(let bar (fun (a b) ())) - -(let make (fun (a b) - (fun (&a &b) ()))) -(let foo (make "hello" 1)) - -(bar (list:find a 0) -1) -(bar (list:find a 2) 1) - -(bar (list:slice a 0 0 1) []) -(bar a [1 2 3]) -(bar (list:slice a 0 3 2) [1 3]) -(bar a [1 2 3]) - -(bar (list:sort [3 1 2]) a) -(bar a [1 2 3]) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/list4.ark b/tests/fuzzing/corpus-cmin/list4.ark deleted file mode 100644 index be3d373e7..000000000 --- a/tests/fuzzing/corpus-cmin/list4.ark +++ /dev/null @@ -1,28 +0,0 @@ -(let a [1 2 3]) -(let b [4 5 6]) - -(let bar (fun (a b) ())) - -(let make (fun (a b) - (fun (&a &b) ()))) -(let foo (make "hello" 1)) - -(bar (list:fill 5 nil) [nil nil nil nil nil]) - -(let c (list:setAt a 1 "b")) -(bar c [1 "b" 3]) -(bar a [1 2 3]) - -(mut c a) -(mut d b) -(append! c 4) -(bar c [1 2 3 4]) -(concat! c d) -(bar c [1 2 3 4 4 5 6]) -(bar d [4 5 6]) -(pop! c -1) -(bar c [1 2 3 4 4 5]) -(pop! c 1) -(bar c [1 3 4 4 5]) -(bar a [1 2 3]) -(bar b [4 5 6]) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/macro_cond.ark b/tests/fuzzing/corpus-cmin/macro_cond.ark deleted file mode 100644 index 1fd358be4..000000000 --- a/tests/fuzzing/corpus-cmin/macro_cond.ark +++ /dev/null @@ -1,2 +0,0 @@ -($ -> (arg fn1 ...fn) { - ($if (> (len fn) 0) (-> (fn1 arg) ...fn) (fn1 arg))}) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/not_callable.ark b/tests/fuzzing/corpus-cmin/not_callable.ark deleted file mode 100644 index 9636f8380..000000000 --- a/tests/fuzzing/corpus-cmin/not_callable.ark +++ /dev/null @@ -1 +0,0 @@ -(()) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/not_enough_args_operator.ark b/tests/fuzzing/corpus-cmin/not_enough_args_operator.ark deleted file mode 100644 index 62cdd377b..000000000 --- a/tests/fuzzing/corpus-cmin/not_enough_args_operator.ark +++ /dev/null @@ -1 +0,0 @@ -(print (!= 1)) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/string.ark b/tests/fuzzing/corpus-cmin/string.ark deleted file mode 100644 index 1908280b8..000000000 --- a/tests/fuzzing/corpus-cmin/string.ark +++ /dev/null @@ -1,10 +0,0 @@ -(let foo (fun (a b) ())) - -(foo "hllo world" (str:removeAt "hello world" 1)) -(foo "ello world" (str:removeAt "hello world" 0)) -(foo "hello worl" (str:removeAt "hello world" 10)) - -(foo -1 (str:find "hello" "help")) -(foo 0 (str:find "hello" "hel")) -(foo 2 (str:find "hello" "llo")) -(foo -1 (str:find "" "1")) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/tests_arkscript_async-tests.ark b/tests/fuzzing/corpus-cmin/tests_arkscript_async-tests.ark new file mode 100644 index 000000000..68ae39e1d --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_arkscript_async-tests.ark @@ -0,0 +1,41 @@ +(import std.Testing) +(import std.List) + +(let foo (fun (a b) (+ a b))) +(let async-foo (async foo 1 2)) + +(let size 1000) +(let data (list:fill size 1)) + +(let sum (fun (a b src) { + (mut acc 0) + (while (< a b) { + (set acc (+ acc (@ src a))) + (set a (+ 1 a))}) + acc })) + +(test:suite async { + (test:case "async-foo should be an awaitable function returning 3" { + (test:eq (type async-foo) "UserType") + (test:eq (await async-foo) 3)}) + + (test:case "calling await on async-foo again should not crash but return nil" { + (test:eq nil (await async-foo))}) + + (test:case "async call is faster than non-async" { + (let start-non-async (time)) + (let res-non-async (sum 0 size data)) + (let time-non-async (- (time) start-non-async)) + + (let start-async (time)) + (let workers [ + (async sum 0 (/ size 4) data) + (async sum (/ size 4) (/ size 2) data) + (async sum (/ size 2) (- size (/ size 4)) data) + (async sum (- size (/ size 4)) size data)]) + (let res-async (list:reduce (list:map workers (fun (w) (await w))) (fun (a b) (+ a b)))) + (let time-async (- (time) start-async)) + + (test:eq 1000 res-async) + (test:eq 1000 res-non-async) + (test:expect (< time-async time-non-async))})}) diff --git a/tests/fuzzing/corpus-cmin/tests_arkscript_builtins-tests.ark b/tests/fuzzing/corpus-cmin/tests_arkscript_builtins-tests.ark new file mode 100644 index 000000000..f4737e7c6 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_arkscript_builtins-tests.ark @@ -0,0 +1,65 @@ +(import std.Testing) + +(let base-list [1 2 3]) +(let base-list-enhanced (concat base-list [4 5])) + +(test:suite builtin { + (test:eq (append (append base-list 4) 5) base-list-enhanced) + (test:eq (concat base-list [4 5]) base-list-enhanced) + (test:eq (type []) "List") + (test:eq (list:reverse base-list) [3 2 1]) + (test:eq (list:reverse []) []) + (test:eq (list:find [] nil) -1) + (test:eq (list:find [12] 12) 0) + (test:eq (list:find [1 2 3] 2) 1) + (test:eq (list:find [12] nil) -1) + (test:eq (list:slice base-list-enhanced 0 3 1) base-list) + (test:eq (list:slice base-list-enhanced 0 1 1) [1]) + (test:eq (list:slice base-list-enhanced 0 3 2) [1 3]) + (test:eq (list:sort [5 4 3 2 1]) [1 2 3 4 5]) + (test:eq (list:sort [5]) [5]) + (test:eq (list:sort []) []) + + # fixme + #(let short_list (list:fill 12 nil)) + #(test:eq (len short_list) 12) + #(mut i 0) + #(while (< i 12) { + # (test:eq (@ short_list i) nil) + # (set i (+ 1 i))}) + #(del i) +# + #(test:eq (@ (list:setAt short_list 5 "a") 5) "a") + #(del short_list) + + (test:expect (not (io:fileExists? "test.txt"))) + (io:writeFile "test.txt" "hello, world!") + (test:expect (io:fileExists? "test.txt")) + (test:eq (io:readFile "test.txt") "hello, world!") + (test:expect (> (len (io:listFiles "./")) 0)) + (test:expect (not (io:dir? "test.txt"))) + (test:expect (not (io:fileExists? "temp"))) + (io:makeDir "temp") + (test:expect (io:fileExists? "temp")) + (test:expect (io:dir? "temp")) + (let old (time)) + (sys:sleep 1) + (test:expect (< old (time))) + + # no need to test str:format, we are already using it for the assertions, + # and it's also heavily tested in the C++ String repository in the ArkScript-lang organization (github) + + (test:eq (str:find "abc" "d") -1) + (test:eq (str:find "abc" "a") 0) + (test:eq (str:find "abc" "bc") 1) + (test:eq (str:find "abcdefghijkl" "defijkl") -1) + (test:eq (str:find "abcdefghijkl" "defghijkl") 3) + (test:eq (str:removeAt "abcdefghijkl" 3) "abcefghijkl") + (test:eq (str:removeAt "abcdefghijkl" 0) "bcdefghijkl") + (test:eq (str:removeAt "abcdefghijkl" 11) "abcdefghijk") + + # no need to test the math functions since they're 1:1 binding of C++ functions and were carefully checked + # before writing this comment, to ensure we aren't binding math:sin to the C++ tan function + + # clean up + (io:removeFiles "test.txt" "temp/") }) diff --git a/tests/fuzzing/corpus-cmin/tests_arkscript_list-tests.ark b/tests/fuzzing/corpus-cmin/tests_arkscript_list-tests.ark new file mode 100644 index 000000000..0da2ea6ff --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_arkscript_list-tests.ark @@ -0,0 +1,72 @@ +(import std.Testing) + +(let a [1 2 3]) +(let b [4 5 6]) + +(test:suite list { + (let make (fun (a b) + (fun (&a &b) ()))) + (let foo (make "hello" 1)) + + # if this is failing, this is most likely to be a compiler problem + (test:eq ["hello" 1] [foo.a foo.b]) + (test:eq 2 (len [foo.a foo.b])) + (test:eq ["hello"] (append [] foo.a)) + + (test:case "append and return a new list" { + (test:eq (append a 4) [1 2 3 4]) + (test:eq a [1 2 3]) + (test:eq (append a a) [1 2 3 [1 2 3]]) + (test:eq a [1 2 3]) }) + + (test:case "concat and return a new list" { + (test:eq (concat a b) [1 2 3 4 5 6]) + (test:eq a [1 2 3]) + (test:eq b [4 5 6]) }) + + (test:case "pop and return a new list" { + (test:eq (pop a 0) [2 3]) + (test:eq (pop a 1) [1 3]) + (test:eq (pop a 2) [1 2]) + (test:eq a [1 2 3]) }) + + (test:case "reverse and return a new list" { + (test:eq (list:reverse a) [3 2 1]) + (test:eq a [1 2 3]) + (test:eq (list:reverse []) []) }) + + (test:case "find element in list" { + (test:eq (list:find a 0) -1) + (test:eq (list:find a 2) 1) }) + + (test:case "slice and return a new list" { + (test:eq (list:slice a 0 0 1) []) + (test:eq a [1 2 3]) + (test:eq (list:slice a 0 3 2) [1 3]) + (test:eq a [1 2 3]) }) + + (test:case "sort and return a new list" { + (test:eq (list:sort [3 1 2]) a) + (test:eq a [1 2 3]) }) + + (test:eq (list:fill 5 nil) [nil nil nil nil nil]) + + (test:case "modify list at index and return a new list" { + (let c (list:setAt a 1 "b")) + (test:eq c [1 "b" 3]) + (test:eq a [1 2 3]) }) + + (test:case "in place list mutation" { + (mut c a) + (mut d b) + (append! c 4) + (test:eq c [1 2 3 4]) + (concat! c d) + (test:eq c [1 2 3 4 4 5 6]) + (test:eq d [4 5 6]) + (pop! c -1) + (test:eq c [1 2 3 4 4 5]) + (pop! c 1) + (test:eq c [1 3 4 4 5]) + (test:eq a [1 2 3]) + (test:eq b [4 5 6]) })}) diff --git a/tests/fuzzing/corpus-cmin/tests_arkscript_macro-tests.ark b/tests/fuzzing/corpus-cmin/tests_arkscript_macro-tests.ark new file mode 100644 index 000000000..be7a0c3dd --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_arkscript_macro-tests.ark @@ -0,0 +1,136 @@ +(import std.Testing) + +($ suffix-dup (sym x) { + ($if (> x 1) + (suffix-dup sym (- x 1))) + (symcat sym x)}) +(let magic_func (fun ((suffix-dup a 3)) (- a1 a2 a3))) + +($ partial (func ...defargs) { + ($ bloc (suffix-dup a (- (argcount func) (len defargs)))) + (fun (bloc) (func ...defargs bloc)) + ($undef bloc)}) + +(let test_func (fun (a b c) (* a b c))) +(let test_func1 (partial test_func 1)) +(let test_func1_2 (partial test_func1 2)) + +(test:suite macro { + ($ nice_value 12) + + (test:case "basic macros" { + ($ void () nil) + (test:eq (void) nil) + + ($ add_two (a b) (+ a b)) + + (test:eq (add_two 1 2) 3) + (test:eq (add_two nice_value 2) 14) }) + + (test:case "conditional macros" { + (test:expect ($if (and true true) true false)) + (test:expect ($if (= nice_value 12) true false)) + (test:expect ($if (and true (= nice_value 12)) true false)) + (test:expect ($if (and false (= nice_value 12)) false true)) + (test:expect ($if (or false (= nice_value 12)) true false)) + (test:expect ($if (or false (!= nice_value 12)) false true)) + (test:expect ($if (not (= nice_value 12)) false true)) + (test:expect ($if (< nice_value 14) true false)) + (test:expect ($if (> nice_value 14) false true)) + (test:expect ($if (<= nice_value 12) true false)) + (test:expect ($if (>= nice_value 12) true false)) + (test:expect ($if (@ [true false] 0) true false)) + (test:expect ($if (@ [true false] -2) true false)) + ($if true { + ($ in_if_1 true) + ($ in_if_2 true)}) + + (test:expect (and in_if_1 in_if_2) "a variable can be defined inside a conditional macro") + ($undef in_if_1) + ($undef in_if_2) }) + + { + ($ val (+ 1 2 3)) + (test:eq val 6 "val should be computed to 6") + + { + ($ val 0) + (test:eq val 0 "val is shadowed") + ($undef val) + (test:eq val 6 "shadowed version should be undefined") + ($undef a)} # shouldn't yield an error on unknown macros + + (test:eq val 6 "val should still resolve to 6")} + + (test:case "macro expansion" { + ($ bar (a ...args) (+ a (len args))) + (test:eq (bar 1) 1) + (test:eq (bar 2 3) 3) + (test:eq (bar 4 5 6) 6) + (test:eq (bar 7 8 9 10) 10) + + ($ egg (...args) (bar ...args)) + (test:eq (egg 1) 1) + (test:eq (egg 0 1) 1) + (test:eq (egg 0 0 0 1) 3) + + ($ h (...args) (head args)) + (test:eq (h) nil) + (test:eq (h 1) 1) + (test:eq (h 1 2) 1) + + ($ g (...args) (tail args)) + (test:eq (g) []) + (test:eq (g 1) []) + (test:eq (g 1 2) [2]) + (test:eq (g 1 2 3) [2 3]) + + ($ one (...args) (@ args 1)) + (test:eq (one 1 2) 2) + (test:eq (one 1 3 4) 3) + (test:eq (one 1 5 6 7 8) 5) + + ($ last (...args) (@ args -1)) + (test:eq (last 1 2) 2) + (test:eq (last 1 3 4) 4) + (test:eq (last 1 5 6 7 8) 8) }) + + (test:case "generate valid arkscript code with macros" { + ($ make-func (retval) (fun () retval)) + (let a-func (make-func 1)) + (test:eq (type a-func) "Function") + (test:eq (a-func) 1) + + ($ defun (name args body) (let name (fun args body))) + (defun foo (a b) (+ a b)) + (test:eq (type foo) "Function") + (test:eq (foo 2 3) 5) + + ($ get_symbol (bloc) (@ bloc 1)) + ($ define (bloc) (let (get_symbol bloc) (@ bloc 2))) + (define (let a 12)) + (test:eq a 12) }) + + (test:case "define variable with a macro adding a suffix" { + ($ nice_value 12) + ($ define (prefix suffix value) (let (symcat prefix suffix) value)) + + (define a 1 2) + (test:eq a1 2) + (define a (+ 1 1) 2) + (test:eq a2 2) + (define a (- 1 1) 2) + (test:eq a0 2) + (define a (+ nice_value 1) 2) + (test:eq a13 2) }) + + (test:case "partial functions" { + (test:eq (magic_func 1 2 3) (- 1 2 3)) + (test:eq (argcount test_func) 3) + (test:eq (argcount test_func1) 2) + (test:eq (argcount test_func1_2) 1) + (test:eq (argcount (fun () ())) 0) + (test:eq (argcount (fun (a) ())) 1) + (test:eq (argcount (fun (a b g h u t) ())) 6) + (test:eq (test_func 1 2 3) (test_func1 2 3)) + (test:eq (test_func 1 2 3) (test_func1_2 3)) })}) diff --git a/tests/fuzzing/corpus-cmin/tests_arkscript_string-tests.ark b/tests/fuzzing/corpus-cmin/tests_arkscript_string-tests.ark new file mode 100644 index 000000000..178f0f768 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_arkscript_string-tests.ark @@ -0,0 +1,14 @@ +(import std.Testing) +(import std.String) + +(test:suite string { + (test:case "remove char in string at index" { + (test:eq "hllo world" (str:removeAt "hello world" 1)) + (test:eq "ello world" (str:removeAt "hello world" 0)) + (test:eq "hello worl" (str:removeAt "hello world" 10)) }) + + (test:case "find substring" { + (test:eq -1 (str:find "hello" "help")) + (test:eq 0 (str:find "hello" "hel")) + (test:eq 2 (str:find "hello" "llo")) + (test:eq -1 (str:find "" "1")) })}) diff --git a/tests/fuzzing/corpus-cmin/tests_arkscript_unittests.ark b/tests/fuzzing/corpus-cmin/tests_arkscript_unittests.ark new file mode 100644 index 000000000..d8bb99d3b --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_arkscript_unittests.ark @@ -0,0 +1,7 @@ +(import vm-tests) +(import builtins-tests) +(import utf8-tests) +(import macro-tests) +(import list-tests) +(import string-tests) +(import async-tests) diff --git a/tests/fuzzing/corpus-cmin/tests_arkscript_utf8-tests.ark b/tests/fuzzing/corpus-cmin/tests_arkscript_utf8-tests.ark new file mode 100644 index 000000000..5294d6adf --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_arkscript_utf8-tests.ark @@ -0,0 +1,32 @@ +(import std.Testing) + +(test:suite utf8 { + (test:case "weird variable names" { + (let ---> 15) + (test:eq ---> 15) + + (let <-- 16) + (test:eq <-- 16) + (test:expect (< ---> <--)) }) + + (test:case "iterating on a list of emojis" { + (let emotes [ + "🥳" "😅" "😥" "👿" "🟢" "🙊" + "💡" "💻" "🌟" "🔹" "🌐" "🤖" + "🖐" "🤔" "🤩" "🤠" "😊"]) + (mut i 0) + (while (< i (len emotes)) { + (test:eq (len (@ emotes i)) 4) + (set i (+ 1 i)) })}) + + (test:case "testing conversion patterns \\u and \\U" { + (test:eq "\U0001f47f" "👿") + (test:eq "\U0001F47F" "👿") + (test:eq "\u1e0b" "ḋ") + (test:eq "\u1E0B" "ḋ") }) + + (test:case "testing emoji codepoints computing" { + (test:eq (str:ord "👺") 128122) + (test:eq (str:chr 128122) "👺") + (test:eq (str:ord "$") 36) + (test:eq (str:chr 36) "$") })}) diff --git a/tests/fuzzing/corpus-cmin/tests_arkscript_vm-tests.ark b/tests/fuzzing/corpus-cmin/tests_arkscript_vm-tests.ark new file mode 100644 index 000000000..6f0cdeeb7 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_arkscript_vm-tests.ark @@ -0,0 +1,139 @@ +(import std.Testing) + +(let tests 0) +(let closure (fun (&tests) ())) +(let make (fun (a b c) + (fun (&a &b &c) ()))) +(let make2 (fun (a b c) + (fun (&a &b &c) ()))) +(let closure_1 (make 1 2 3)) +(let closure_1_bis closure_1) +(let closure_2 (make 1 2 3)) +(let closure_3 (make 3 2 3)) +(let closure_4 (make2 1 2 3)) + +(let inner 0) +(let call (fun () { + (set val 5) + (set inner 12) })) +(let get (fun () [val inner])) +(let child (fun (&inner &call &get) ())) +(mut val 1) +(let parent (fun (&val &child) ())) + +(let create-human (fun (name age) { + (let set-age (fun (new-age) (set age new-age))) + (fun (&set-age &name &age) ()) })) +(let bob (create-human "Bob" 38)) + +(test:suite vm { + (test:case "arithmetic operations" { + (test:eq (+ 1 2) 3) + (test:eq (+ 1.5 2.5) 4.0) + (test:eq (- 1 2) -1) + (test:eq (- 1.5 2) -0.5) + (test:eq (/ 1 2) 0.5) + (test:eq (/ 10 2) 5) + (test:eq (* 1 2) 2) + (test:eq (* 0.5 2) 1) + (test:eq (mod 12 5) 2) + (test:eq (mod 12.5 5.5) 1.5) }) + + (test:case "comparisons" { + (test:expect (> 0 -4)) + (test:expect (> "hello" "a")) + (test:expect (< -4 0)) + (test:expect (< "abc" "super man")) + (test:expect (<= -4 0)) + (test:expect (<= "abc" "abc")) + (test:expect (<= "abc" "super man")) + (test:expect (>= 0 -4)) + (test:expect (>= "hello" "hello")) + (test:expect (>= "hello" "abc")) + (test:neq "hello" "abc") + (test:neq nil true) + (test:neq nil false) + (test:neq true false) + (test:neq [] "") + (test:neq "" 1) + (test:neq "" nil) + (test:neq "" true) + (test:neq "" false) }) + + (test:case "lengths and list operations" { + (test:eq (len "hello") 5) + (test:eq (len "") 0) + (test:eq (len [""]) 1) + (test:eq (len []) 0) + (test:expect (empty? "")) + (test:expect (empty? [])) + (test:eq (tail "") "") + (test:eq (tail "a") "") + (test:eq (tail "abc") "bc") + (test:eq (tail []) []) + (test:eq (tail [1]) []) + (test:eq (tail [1 2 3]) [2 3]) + (test:eq (head "") "") + (test:eq (head "a") "a") + (test:eq (head "abc") "a") + (test:eq (head []) nil) + (test:eq (head [1]) 1) + (test:eq (head [1 2 3]) 1) + (test:expect (nil? nil)) + (test:expect (not (nil? ""))) + (test:expect (not (nil? []))) }) + + (test:case "conversions" { + (test:eq (toNumber "12") 12) + (test:eq (toNumber "abc") nil) + (test:eq (toNumber "-12.5") -12.5) + (test:eq (toString 12) "12") + (test:eq (toString nil) "nil") + (test:eq (toString true) "true") + (test:eq (toString false) "false") + (test:eq (toString [1 2]) "[1 2]") + (test:eq (toString ["12"]) "[\"12\"]") }) + + (test:case "indexing" { + (test:eq (@ "hello" 1) "e") + (test:eq (@ "hello" -1) "o") + (test:eq (@ "hello" -4) "e") + (test:eq (@ ["h" "e" "l" "l" "o"] 1) "e") + (test:eq (@ ["h" "e" "l" "l" "o"] -1) "o") + (test:eq (@ ["h" "e" "l" "l" "o"] -4) "e") }) + + (test:case "De Morgan's law" { + (test:expect (and true true true)) + (test:expect (not (and true nil true))) + (test:expect (or false true nil)) + (test:expect (not (or false "" nil))) }) + + (test:case "types" { + (test:eq (type []) "List") + (test:eq (type 1) "Number") + (test:eq (type "") "String") + (test:eq (type make) "Function") + (test:eq (type print) "CProc") + (test:eq (type closure) "Closure") + (test:eq (type nil) "Nil") + (test:eq (type true) "Bool") + (test:eq (type false) "Bool") + (test:expect (hasField closure "tests")) + (test:expect (not (hasField closure "12"))) }) + + (test:case "closures" { + (test:eq (toString closure) "(.tests=0)") + (test:eq closure_1 closure_1_bis) + (test:eq closure_1 closure_2) + (test:neq closure_1 closure_4) + (test:neq closure_2 closure_3) + (test:neq closure_1 closure_3) + (test:neq closure closure_1) + + (test:eq bob.age 38) + (bob.set-age 40) + (test:eq bob.age 40) + + (test:eq (parent.child.get) [1 0]) + (parent.child.call) + (test:eq (parent.child.get) [5 12]) })}) diff --git a/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_parser_big.ark b/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_parser_big.ark new file mode 100644 index 000000000..2d9cee185 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_parser_big.ark @@ -0,0 +1,318 @@ +# @brief Iterate over a given list and run a given function on every element. +# @param _L the list to iterate over +# @param _func the function to call on each element +# @details The original list is left unmodified. +# =begin +# (import "List.ark") +# (let collection [1 2 5 12]) +# (list:forEach collection (fun (element) { +# (print element) +# })) +# =end +# @author https://github.com/SuperFola +(let list:forEach (fun (_L _func) { + (mut _index 0) + (while (< _index (len _L)) { + (mut _element (@ _L _index)) + (_func _element) + (set _index (+ 1 _index))})})) + +# @brief Iterate over a given list and multiply all the elements with the others. +# @param _L the list to iterate over +# @details The original list is left unmodified. +# =begin +# (import "List.ark") +# (let collection [1 2 5 12]) +# (let p (list:product collection)) # => 120 +# =end +# @author https://github.com/FrenchMasterSword +(let list:product (fun (_L) { + (mut _index 0) + (mut _output 1) + (while (< _index (len _L)) { + (set _output (* _output (@ _L _index))) + (set _index (+ 1 _index))}) + _output })) + +# @brief Iterate over a given list and sum all the elements. +# @param _L the list to iterate over +# @details The original list is left unmodified. +# =begin +# (import "List.ark") +# (let collection [1 2 5 12]) +# (let p (list:sum collection)) # => 20 +# =end +# @author https://github.com/FrenchMasterSword +(let list:sum (fun (_L) { + (mut _index 0) + (mut _output 0) + (while (< _index (len _L)) { + (set _output (+ _output (@ _L _index))) + (set _index (+ 1 _index))}) + _output })) + +(import lib.math :min :max) # needed for math:min, math:max + +# @brief Drop the first n elements of a list +# @param _L the list to work on +# @param _n the number of elements to drop +# @details The original list is left unmodified. +# =begin +# (let cool-stuff [1 2 3 4 5 6 7 8 9]) +# (print (list:drop cool-stuff 4)) # [5 6 7 8 9] +# =end +# @author https://github.com/rstefanic, https://github.com/SuperFola +(let list:drop (fun (_L _n) + (if (< _n (/ (len _L) 2)) + (if (> _n 0) + (list:drop (tail _L) (- _n 1)) + _L) + { + (mut _index (max 0 _n)) + (mut _output []) + (while (< _index (len _L)) { + (set _output (append _output (@ _L _index))) + (set _index (+ 1 _index))}) + _output }))) + +# @brief Drop the first elements of a list, while they match a given predicate +# @param _L the list to work on +# @param _f the predicate +# @details The original list is left unmodified. +# =begin +# (let cool-stuff [1 2 3 4 5 6 7 8 9]) +# (print (list:dropWhile cool-stuff (fun (a) (< a 4)))) # [4 5 6 7 8 9] +# =end +# @author https://github.com/SuperFola +(let list:dropWhile (fun (_L _f) { + (mut _index 0) + (mut _output []) + (while (< _index (len _L)) + (if (_f (@ _L _index)) + (set _index (+ 1 _index)) + + (while (< _index (len _L)) { + (set _output (append _output (@ _L _index))) + (set _index (+ 1 _index))}))) + _output })) + +# @brief Keep elements in a given list if they follow a predicate +# @param _L the list to work on +# @param _f the predicate +# @details The original list is left unmodified. +# =begin +# (import "Math.ark") +# (print (list:filter [1 2 3 4 5 6 7 8 9] math:even)) # [2 4 6 8] +# =end +# @author https://github.com/rstefanic +(let list:filter (fun (_L _f) { + (mut _index 0) + (mut _output []) + (while (< _index (len _L)) { + (if (_f (@ _L _index)) + (set _output (append _output (@ _L _index)))) + (set _index (+ 1 _index))}) + _output })) + +# @brief Apply a given function to each element of a list +# @param _L the list to work on +# @param _f the function to apply to each element +# @details The original list is left unmodified. +# =begin +# (print (list:map [1 2 3 4 5 6 7 8 9] (fun (e) (* e e)))) # [1 4 9 25 36 49 64 81] +# =end +# @author https://github.com/rstefanic +(let list:map (fun (_L _f) { + (mut _index 0) + (mut _output []) + (while (< _index (len _L)) { + (set _output (append _output (_f (@ _L _index)))) + (set _index (+ 1 _index))}) + _output })) + +# @brief Apply a function to the elements of a list to reduce it +# @param _L the list to work on +# @param _f the function to apply +# @details The original list is left unmodified. +# =begin +# (let cool [1 2 3 4 5 6 7 8 9]) +# (print (list:reduce cool (fun (a b) (+ a b)))) # 45 +# =end +# @author https://github.com/FrenchMasterSword +(let list:reduce (fun (_L _f) { + (mut _index 1) + (mut _output (@ _L 0)) + (while (< _index (len _L)) { + (set _output (_f _output (@ _L _index))) + (set _index (+ 1 _index))}) + _output })) + +# @brief Flatten a list +# @param _L the list to work on +# @details The original list is left unmodified. +# =begin +# (let cool [[1 2 3] [4] 5 6 [7 8] 9]) +# (print (list:flatten cool)) # [1 2 3 4 5 6 7 8 9] +# =end +# @author https://github.com/SuperFola +(let list:flatten (fun (_L) { + (mut _index 0) + (mut _output []) + (while (< _index (len _L)) { + (mut _sub (@ _L _index)) + (set _output (if (= "List" (type _sub)) + (concat _output _sub) + (append _output _sub))) + (set _index (+ 1 _index))}) + _output })) + +# @brief Apply a given function to each element of a list and then flatten it +# @param _L the list to work on +# @param _f the function to apply to each element +# @details The original list is left unmodified. +# =begin +# (let cool [1 2 3 4]) +# (print (list:flatMap cool (fun (a) [a a]))) # [1 1 2 2 3 3 4 4] +# =end +# @author https://github.com/SuperFola +(let list:flatMap (fun (_L _f) { + (mut _index 0) + (mut _output []) + (while (< _index (len _L)) { + (mut _res (_f (@ _L _index))) + (set _output (if (= "List" (type _res)) + (concat _output _res) + (append _output _res))) + (set _index (+ 1 _index))}) + _output })) + +# @brief Take the first n elements of +# @param _L the list to work on +# @param _n the number of elements to take +# @details The original list is left unmodified. +# =begin +# (print (list:take [1 2 3 4 5 6 7 8 9] 4)) # [1 2 3 4] +# =end +# @author https://github.com/rstefanic +(let list:take (fun (_L _n) { + (mut _index 0) + (mut _output []) + (set _n (min _n (len _L))) + + (while (< _index _n) { + (set _output (append _output (@ _L _index))) + (set _index (+ 1 _index))}) + _output })) + +# @brief Take the first n elements of a list, given a predicate +# @param _L the list to work on +# @param _f the predicate +# @details The original list is left unmodified. +# =begin +# (print (takeWhile [1 2 3 4 5 6 7 8 9 10] (fun (a) (< a 4)))) # [1 2 3] +# =end +# @author https://github.com/rakista112 +(let list:takeWhile (fun (_L _f) { + (mut _index 0) + (mut _output []) + (mut continue true) + (while (and (< _index (len _L)) continue) + (if (_f (@ _L _index)) + { + (set _output (append _output (@ _L _index))) + (set _index (+ 1 _index))} + (set continue false))) + _output })) + +# @brief Unzip a list of [[a b] [c d]...] into [[a c ...] [b d ...]] +# @param _L the list to work on +# @details The original list is left unmodified. +# =begin +# (let zipped [[1 5] [2 6] [3 7] [4 8]]) +# (print (list:unzip zipped)) # [[1 2 3 4] [5 6 7 8]] +# =end +# @author https://github.com/FrenchMasterSword +(let list:unzip (fun (_L) { + (let _m (len _L)) + (mut _list1 []) + (mut _list2 []) + (mut _index 0) + (while (< _index _m) { + (mut current (@ _L _index)) + (set _list1 (append _list1 (@ current 0))) + (set _list2 (append _list2 (@ current 1))) + (set _index (+ 1 _index))}) + [_list1 _list2] })) + +# @brief Zip two lists into one: [1 2 3 4] and [5 6 7 8] will give [[1 5] [2 6] [3 7] [4 8]] +# @param _a the first list to work on +# @param _b the second list to work on +# @details The original lists are left unmodified. +# =begin +# (let a [1 2 3 4]) +# (let b [5 6 7 8]) +# (print (list:zip a b)) # [[1 5] [2 6] [3 7] [4 8]] +# =end +# @author https://github.com/FrenchMasterSword +(let list:zip (fun (_a _b) { + (let _m (min (len _a) (len _b))) + (mut _c []) + (mut _index 0) + (while (< _index _m) { + (set _c (append _c [(@ _a _index) (@ _b _index)])) + (set _index (+ 1 _index))}) + _c })) + +# @brief Fold a given list, starting from the left side +# @param _L the list to work on +# @param _init an init value +# @param _f a function to apply to the list +# @details The original list is left unmodified. +# =begin +# (let a [1 2 3 4]) +# (print (list:foldLeft a 0 (fun (a b) (+ a b)))) # 10 +# =end +# @author https://github.com/SuperFola +(let list:foldLeft (fun (_L _init _f) { + (mut _index 0) + (mut _val _init) + (while (< _index (len _L)) { + (set _val (_f _val (@ _L _index))) + (set _index (+ 1 _index))}) + _val })) + +# @brief Check if a condition is verified for all elements of a list +# @param _L the list to work on +# @param _f the conditon +# =begin +# (let a [1 2 3 4]) +# (let f (fun (e) (< e 5))) +# (print (list:forAll a f)) # true +# =end +# @author https://github.com/Gryfenfer97 +(let list:forAll (fun (_L _f) { + (mut _verified true) + (mut _index 0) + (while (and _verified (< _index (len _L))) { + (if (not (_f (@ _L _index))) + (set _verified false)) + (set _index (+ 1 _index))}) + _verified })) + +# @brief Check if a condition if verified for one or more elements of a list +# @param _L the list to work on +# @param _f the conditon +# =begin +# (let a [1 2 3 4]) +# (let f (fun (e) (< e 3))) +# (print (list:any a f)) # true +# =end +# @author https://github.com/Gryfenfer97 +(let list:any (fun (_L _f) { + (mut _verified false) + (mut _index 0) + (while (and (not _verified) (< _index (len _L))) { + (if (_f (@ _L _index)) + (set _verified true)) + (set _index (+ 1 _index))}) + _verified })) diff --git a/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_parser_medium.ark b/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_parser_medium.ark new file mode 100644 index 000000000..62d05c3e1 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_parser_medium.ark @@ -0,0 +1,25 @@ +# a function which just prints its argument +(let egg (fun (bar) (print bar))) +# the data we're going to give to this function +(let data ["Iron Man" "is" "Tony Stark"]) +# a list of function call which should be executed later on +(mut callbacks []) + +(print "Data: " data) +(print "Generating callbacks") +(mut acc 0) +# here we are filling the list callbacks +(while (notEq acc (len data)) { + (mut d (at data acc)) + (set callbacks (append callbacks (fun (&d) (egg d)))) + (set acc (add 1 acc))}) + +# then we reset the accumulator +(set acc 0) +(while (notEq acc (len callbacks)) { + (mut var (at callback acc)) + (print "stored: " var.d) + (puts "Calling callback number " acc ": ") + (mut stored (at callbacks acc)) + (stored) + (set acc (add 1 acc))}) diff --git a/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_parser_simple.ark b/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_parser_simple.ark new file mode 100644 index 000000000..89acfc1a6 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_parser_simple.ark @@ -0,0 +1,12 @@ +(import some.important :code :base) + +(let a (if (equal b c) 1 "4")) +(if (foo a) + (print a " is a very interesting variable")) + +(mut foo (fun (bar egg &captured) { + (let yes indeed) + (add 1 yes)})) + +(while true { + (foo true nil false)}) diff --git a/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_ackermann.ark b/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_ackermann.ark new file mode 100644 index 000000000..355a9969f --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_ackermann.ark @@ -0,0 +1,11 @@ +(let ackermann (fun (m n) { + (if (> m 0) + # then + (if (= 0 n) + # then + (ackermann (- m 1) 1) + # else + (ackermann (- m 1) (ackermann m (- n 1)))) + # else + (+ 1 n))})) +(ackermann 3 7) diff --git a/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_fibonacci.ark b/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_fibonacci.ark new file mode 100644 index 000000000..0e6a3b298 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_fibonacci.ark @@ -0,0 +1,5 @@ +(let fibo (fun (n) + (if (< n 2) + n + (+ (fibo (- n 1)) (fibo (- n 2)))))) +(fibo 22) diff --git a/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_man_or_boy_test.ark b/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_man_or_boy_test.ark new file mode 100644 index 000000000..9f4aca38e --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_man_or_boy_test.ark @@ -0,0 +1,9 @@ +(let A (fun (k x1 x2 x3 x4 x5) { + (let B (fun () { + (set k (- k 1)) + (A k B x1 x2 x3 x4) })) + (if (<= k 0) + (+ (x4) (x5)) + (B)) })) + +(A 3 (fun () 1) (fun () -1) (fun () -1) (fun () 1) (fun () 0)) diff --git a/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_quicksort.ark b/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_quicksort.ark new file mode 100644 index 000000000..f8f2fbf2f --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_quicksort.ark @@ -0,0 +1,21 @@ +(let filter (fun (lst cond) { + (mut output []) + (mut i 0) + (while (< i (len lst)) { + (if (cond (@ lst i)) + (append! output (@ lst i))) + (set i (+ 1 i))}) + output })) + +(let quicksort (fun (array) { + (if (empty? array) + [] + { + (let pivot (head array)) + (mut less (quicksort (filter (tail array) (fun (e) (< e pivot))))) + (let more (quicksort (filter (tail array) (fun (e) (>= e pivot))))) + (concat! less [pivot] more) + less })})) + +(let a [3 6 1 5 1 65 324 765 1 6 3 0 6 9 6 5 3 2 5 6 7 64 645 7 345 432 432 4 324 23]) +(quicksort a) diff --git a/tests/fuzzing/corpus-cmin/tests_errors_callable_arity_error_async.ark b/tests/fuzzing/corpus-cmin/tests_errors_callable_arity_error_async.ark new file mode 100644 index 000000000..aab7f8c96 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_errors_callable_arity_error_async.ark @@ -0,0 +1,4 @@ +(let sum (fun (a b c) + (+ a b c))) + +(await (async sum 1 2 3 4)) diff --git a/tests/fuzzing/corpus-cmin/fmt_arg_not_found.ark b/tests/fuzzing/corpus-cmin/tests_errors_callable_fmt_arg_not_found.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/fmt_arg_not_found.ark rename to tests/fuzzing/corpus-cmin/tests_errors_callable_fmt_arg_not_found.ark diff --git a/tests/fuzzing/corpus-cmin/tests_errors_callable_not_callable.ark b/tests/fuzzing/corpus-cmin/tests_errors_callable_not_callable.ark new file mode 100644 index 000000000..fbb2ed7bd --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_errors_callable_not_callable.ark @@ -0,0 +1 @@ +(()) diff --git a/tests/fuzzing/corpus-cmin/not_enough_args_callable.ark b/tests/fuzzing/corpus-cmin/tests_errors_callable_not_enough_args.ark similarity index 78% rename from tests/fuzzing/corpus-cmin/not_enough_args_callable.ark rename to tests/fuzzing/corpus-cmin/tests_errors_callable_not_enough_args.ark index 805f74cc8..b481f6e4d 100644 --- a/tests/fuzzing/corpus-cmin/not_enough_args_callable.ark +++ b/tests/fuzzing/corpus-cmin/tests_errors_callable_not_enough_args.ark @@ -1,2 +1,2 @@ (let foo (fun (a b) (+ a b))) -(foo 1) \ No newline at end of file +(foo 1) diff --git a/tests/fuzzing/corpus-cmin/recursion_depth.ark b/tests/fuzzing/corpus-cmin/tests_errors_callable_recursion_depth.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/recursion_depth.ark rename to tests/fuzzing/corpus-cmin/tests_errors_callable_recursion_depth.ark diff --git a/tests/fuzzing/corpus-cmin/too_many_args_callable.ark b/tests/fuzzing/corpus-cmin/tests_errors_callable_too_many_args.ark similarity index 71% rename from tests/fuzzing/corpus-cmin/too_many_args_callable.ark rename to tests/fuzzing/corpus-cmin/tests_errors_callable_too_many_args.ark index be693ae92..2642f4391 100644 --- a/tests/fuzzing/corpus-cmin/too_many_args_callable.ark +++ b/tests/fuzzing/corpus-cmin/tests_errors_callable_too_many_args.ark @@ -1,2 +1,2 @@ (let foo (fun (a b) (+ a b))) -(foo 1 2 3) \ No newline at end of file +(foo 1 2 3) diff --git a/tests/fuzzing/corpus-cmin/can_not_call.ark b/tests/fuzzing/corpus-cmin/tests_errors_capture_can_not_call.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/can_not_call.ark rename to tests/fuzzing/corpus-cmin/tests_errors_capture_can_not_call.ark diff --git a/tests/fuzzing/corpus-cmin/tests_errors_capture_unbound.ark b/tests/fuzzing/corpus-cmin/tests_errors_capture_unbound.ark new file mode 100644 index 000000000..165f289b0 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_errors_capture_unbound.ark @@ -0,0 +1 @@ +(mut d (fun (&d) (print d))) diff --git a/tests/fuzzing/corpus-cmin/tests_errors_compiler_import_too_long.ark b/tests/fuzzing/corpus-cmin/tests_errors_compiler_import_too_long.ark new file mode 100644 index 000000000..15c181fbc --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_errors_compiler_import_too_long.ark @@ -0,0 +1 @@ +(import 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.00000000000000000000000000000000000000000000.000.0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fun00000000000000000000000000000000000000000000000000000000000000000000.00) diff --git a/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_codepoint.ark b/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_codepoint.ark new file mode 100644 index 000000000..25796857e --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_codepoint.ark @@ -0,0 +1 @@ +� diff --git a/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_escape_seq.ark b/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_escape_seq.ark new file mode 100644 index 000000000..03e23bdc4 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_escape_seq.ark @@ -0,0 +1 @@ +(print "\0") diff --git a/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_func.ark b/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_func.ark new file mode 100644 index 000000000..e2e4c0a31 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_func.ark @@ -0,0 +1 @@ +(let foo (fun (a b) ($ a b))) diff --git a/tests/fuzzing/corpus-cmin/invalid_let.ark b/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_let.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/invalid_let.ark rename to tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_let.ark diff --git a/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_node_in_call.ark b/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_node_in_call.ark new file mode 100644 index 000000000..b47e26f18 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_node_in_call.ark @@ -0,0 +1,2 @@ +(let foo (fun (a) ())) +(foo {}) diff --git a/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_node_in_list.ark b/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_node_in_list.ark new file mode 100644 index 000000000..4384732e5 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_node_in_list.ark @@ -0,0 +1 @@ +[(mut c 1)] diff --git a/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_node_in_ope.ark b/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_node_in_ope.ark new file mode 100644 index 000000000..1d52c5b6c --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_node_in_ope.ark @@ -0,0 +1 @@ +(+ {} 1) diff --git a/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_node_in_tail_call.ark b/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_node_in_tail_call.ark new file mode 100644 index 000000000..d3e242491 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_node_in_tail_call.ark @@ -0,0 +1,2 @@ +(let foo (fun (a) (foo {}))) +(foo 1) diff --git a/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_while.ark b/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_while.ark new file mode 100644 index 000000000..021d422aa --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_errors_compiler_invalid_while.ark @@ -0,0 +1,3 @@ +(while ($ a b) { + (set acc (+ acc (@ src a))) + (set a (+ 1 a))}) diff --git a/tests/fuzzing/corpus-cmin/let_no_sym.ark b/tests/fuzzing/corpus-cmin/tests_errors_compiler_let_no_sym.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/let_no_sym.ark rename to tests/fuzzing/corpus-cmin/tests_errors_compiler_let_no_sym.ark diff --git a/tests/fuzzing/corpus-cmin/tests_errors_compiler_sub_import_too_long.ark b/tests/fuzzing/corpus-cmin/tests_errors_compiler_sub_import_too_long.ark new file mode 100644 index 000000000..5161ce9b2 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_errors_compiler_sub_import_too_long.ark @@ -0,0 +1 @@ +(import a.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) diff --git a/tests/fuzzing/corpus-cmin/tests_errors_compiler_type_no_args.ark b/tests/fuzzing/corpus-cmin/tests_errors_compiler_type_no_args.ark new file mode 100644 index 000000000..5bc2db7dc --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_errors_compiler_type_no_args.ark @@ -0,0 +1 @@ +(print (type)) diff --git a/tests/fuzzing/corpus-cmin/well_formed_args.ark b/tests/fuzzing/corpus-cmin/tests_errors_compiler_well_formed_args.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/well_formed_args.ark rename to tests/fuzzing/corpus-cmin/tests_errors_compiler_well_formed_args.ark diff --git a/tests/fuzzing/corpus-cmin/at_out_of_range.ark b/tests/fuzzing/corpus-cmin/tests_errors_index_at_out_of_range.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/at_out_of_range.ark rename to tests/fuzzing/corpus-cmin/tests_errors_index_at_out_of_range.ark diff --git a/tests/fuzzing/corpus-cmin/at_str_out_of_range.ark b/tests/fuzzing/corpus-cmin/tests_errors_index_at_str_out_of_range.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/at_str_out_of_range.ark rename to tests/fuzzing/corpus-cmin/tests_errors_index_at_str_out_of_range.ark diff --git a/tests/fuzzing/corpus-cmin/pop_out_of_range.ark b/tests/fuzzing/corpus-cmin/tests_errors_index_pop_out_of_range.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/pop_out_of_range.ark rename to tests/fuzzing/corpus-cmin/tests_errors_index_pop_out_of_range.ark diff --git a/tests/fuzzing/corpus-cmin/argcount_unknown_arg.ark b/tests/fuzzing/corpus-cmin/tests_errors_macros_argcount_unknown_arg.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/argcount_unknown_arg.ark rename to tests/fuzzing/corpus-cmin/tests_errors_macros_argcount_unknown_arg.ark diff --git a/tests/fuzzing/corpus-cmin/macro_at_out_of_range.ark b/tests/fuzzing/corpus-cmin/tests_errors_macros_at_out_of_range.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/macro_at_out_of_range.ark rename to tests/fuzzing/corpus-cmin/tests_errors_macros_at_out_of_range.ark diff --git a/tests/fuzzing/corpus-cmin/tests_errors_macros_duplicated_arg.ark b/tests/fuzzing/corpus-cmin/tests_errors_macros_duplicated_arg.ark new file mode 100644 index 000000000..1a98502ed --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_errors_macros_duplicated_arg.ark @@ -0,0 +1,17 @@ +($ -> (arg fn ...fn) { + ($if (> (len fn) 0) + (-> (fn1 arg) ...fn) + (fn1 arg))}) + +(let filename "a") + +(let f1 (fun (data) { + (+ data "000")})) +(let f2 (fun (data) { + (+ data "002")})) +(let f3 (fun (data) { + (+ data "003")})) +(let f4 (fun (data) { + (+ data "004")})) + +(print (-> filename f1 f2 f3 f4)) diff --git a/tests/fuzzing/corpus-cmin/tests_errors_macros_invalid_let_in_macro.ark b/tests/fuzzing/corpus-cmin/tests_errors_macros_invalid_let_in_macro.ark new file mode 100644 index 000000000..23b7761e2 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_errors_macros_invalid_let_in_macro.ark @@ -0,0 +1,3 @@ +($ defun (name args body) (let 0000 (fun args body))) +(defun a_func (a b) (+ a b)) +(print (a_func 1 2)) diff --git a/tests/fuzzing/corpus-cmin/tests_errors_macros_invalid_sym_func_def.ark b/tests/fuzzing/corpus-cmin/tests_errors_macros_invalid_sym_func_def.ark new file mode 100644 index 000000000..36f8429ad --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_errors_macros_invalid_sym_func_def.ark @@ -0,0 +1,2 @@ +($ defun (name args body) (let name (fun args body))) +(defun 0 (a b) (+ a b)) diff --git a/tests/fuzzing/corpus-cmin/tests_errors_macros_max_depth.ark b/tests/fuzzing/corpus-cmin/tests_errors_macros_max_depth.ark new file mode 100644 index 000000000..ded7da302 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_errors_macros_max_depth.ark @@ -0,0 +1,2 @@ +($ size (/ size 4)) +(let sum size) diff --git a/tests/fuzzing/corpus-cmin/tests_errors_macros_max_unification_depth.ark b/tests/fuzzing/corpus-cmin/tests_errors_macros_max_unification_depth.ark new file mode 100644 index 000000000..ecad62b8e --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_errors_macros_max_unification_depth.ark @@ -0,0 +1,20 @@ +($ suffix-dup (sym x){ + ($if (+ x 1) + est_func + ($ p (a b c) (* a b c))) + (symcat sym x)}) + +($ partial (func ...defargs) { + ($ bloc (suffix-dup a (len defargs))) + (fun (bloc) (func ...defargs bloc)) + ($undef bloc)}) + +(let test + (partial + (* a b) + (let inner (partial te t_func 0)) + (let est_func + ($ partial (func ...defargs) { + ($ bloc (suffix-dup a (len defargs))) + (fun (bloc) (func ...defargs bloc)) + ($undef bloc)})))) diff --git a/tests/fuzzing/corpus-cmin/not_enough_args_macro.ark b/tests/fuzzing/corpus-cmin/tests_errors_macros_not_enough_args.ark similarity index 75% rename from tests/fuzzing/corpus-cmin/not_enough_args_macro.ark rename to tests/fuzzing/corpus-cmin/tests_errors_macros_not_enough_args.ark index ab064e540..49430d0c1 100644 --- a/tests/fuzzing/corpus-cmin/not_enough_args_macro.ark +++ b/tests/fuzzing/corpus-cmin/tests_errors_macros_not_enough_args.ark @@ -1,4 +1,4 @@ ($ foo (a b c) (+ a b c)) -(foo 1 2) \ No newline at end of file +(foo 1 2) diff --git a/tests/fuzzing/corpus-cmin/too_many_args_macro.ark b/tests/fuzzing/corpus-cmin/tests_errors_macros_too_many_args.ark similarity index 68% rename from tests/fuzzing/corpus-cmin/too_many_args_macro.ark rename to tests/fuzzing/corpus-cmin/tests_errors_macros_too_many_args.ark index 3dc047cb6..d864d5440 100644 --- a/tests/fuzzing/corpus-cmin/too_many_args_macro.ark +++ b/tests/fuzzing/corpus-cmin/tests_errors_macros_too_many_args.ark @@ -1,4 +1,4 @@ ($ foo (a b c) (+ a b c)) -(foo 1 2 3 4) \ No newline at end of file +(foo 1 2 3 4) diff --git a/tests/fuzzing/corpus-cmin/tests_errors_macros_unevaluated_spread.ark b/tests/fuzzing/corpus-cmin/tests_errors_macros_unevaluated_spread.ark new file mode 100644 index 000000000..8c24b14bc --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_errors_macros_unevaluated_spread.ark @@ -0,0 +1,4 @@ +($ partial { + (fun (a) (func ...defargs)) }) + +(let b (partial)) diff --git a/tests/fuzzing/corpus-cmin/append_in_place.ark b/tests/fuzzing/corpus-cmin/tests_errors_mutability_append_in_place.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/append_in_place.ark rename to tests/fuzzing/corpus-cmin/tests_errors_mutability_append_in_place.ark diff --git a/tests/fuzzing/corpus-cmin/concat_in_place.ark b/tests/fuzzing/corpus-cmin/tests_errors_mutability_concat_in_place.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/concat_in_place.ark rename to tests/fuzzing/corpus-cmin/tests_errors_mutability_concat_in_place.ark diff --git a/tests/fuzzing/corpus-cmin/pop_in_place.ark b/tests/fuzzing/corpus-cmin/tests_errors_mutability_pop_in_place.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/pop_in_place.ark rename to tests/fuzzing/corpus-cmin/tests_errors_mutability_pop_in_place.ark diff --git a/tests/fuzzing/corpus-cmin/redefine_var.ark b/tests/fuzzing/corpus-cmin/tests_errors_mutability_redefine.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/redefine_var.ark rename to tests/fuzzing/corpus-cmin/tests_errors_mutability_redefine.ark diff --git a/tests/fuzzing/corpus-cmin/self_concat.ark b/tests/fuzzing/corpus-cmin/tests_errors_mutability_self_concat.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/self_concat.ark rename to tests/fuzzing/corpus-cmin/tests_errors_mutability_self_concat.ark diff --git a/tests/fuzzing/corpus-cmin/set_const.ark b/tests/fuzzing/corpus-cmin/tests_errors_mutability_set_const.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/set_const.ark rename to tests/fuzzing/corpus-cmin/tests_errors_mutability_set_const.ark diff --git a/tests/fuzzing/corpus-cmin/db0.ark b/tests/fuzzing/corpus-cmin/tests_errors_operators_db0.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/db0.ark rename to tests/fuzzing/corpus-cmin/tests_errors_operators_db0.ark diff --git a/tests/fuzzing/corpus-cmin/ope_freestanding.ark b/tests/fuzzing/corpus-cmin/tests_errors_operators_freestanding.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/ope_freestanding.ark rename to tests/fuzzing/corpus-cmin/tests_errors_operators_freestanding.ark diff --git a/tests/fuzzing/corpus-cmin/ope_no_args.ark b/tests/fuzzing/corpus-cmin/tests_errors_operators_no_args.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/ope_no_args.ark rename to tests/fuzzing/corpus-cmin/tests_errors_operators_no_args.ark diff --git a/tests/fuzzing/corpus-cmin/tests_errors_operators_not_enough_args.ark b/tests/fuzzing/corpus-cmin/tests_errors_operators_not_enough_args.ark new file mode 100644 index 000000000..26e342e2d --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_errors_operators_not_enough_args.ark @@ -0,0 +1 @@ +(print (!= 1)) diff --git a/tests/fuzzing/corpus-cmin/del_unbound.ark b/tests/fuzzing/corpus-cmin/tests_errors_scope_del_unbound.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/del_unbound.ark rename to tests/fuzzing/corpus-cmin/tests_errors_scope_del_unbound.ark diff --git a/tests/fuzzing/corpus-cmin/set_unbound.ark b/tests/fuzzing/corpus-cmin/tests_errors_scope_set_unbound.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/set_unbound.ark rename to tests/fuzzing/corpus-cmin/tests_errors_scope_set_unbound.ark diff --git a/tests/fuzzing/corpus-cmin/unbound.ark b/tests/fuzzing/corpus-cmin/tests_errors_scope_unbound.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/unbound.ark rename to tests/fuzzing/corpus-cmin/tests_errors_scope_unbound.ark diff --git a/tests/fuzzing/corpus-cmin/nil_not_a_function.ark b/tests/fuzzing/corpus-cmin/tests_errors_type_nil_not_a_function.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/nil_not_a_function.ark rename to tests/fuzzing/corpus-cmin/tests_errors_type_nil_not_a_function.ark diff --git a/tests/fuzzing/corpus-cmin/not_a_closure.ark b/tests/fuzzing/corpus-cmin/tests_errors_type_not_a_closure.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/not_a_closure.ark rename to tests/fuzzing/corpus-cmin/tests_errors_type_not_a_closure.ark diff --git a/tests/fuzzing/corpus-cmin/unknown_field.ark b/tests/fuzzing/corpus-cmin/tests_errors_type_unknown_field.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/unknown_field.ark rename to tests/fuzzing/corpus-cmin/tests_errors_type_unknown_field.ark diff --git a/tests/fuzzing/corpus-cmin/99bottles.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_99bottles.ark similarity index 98% rename from tests/fuzzing/corpus-cmin/99bottles.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_99bottles.ark index 03f599f99..d96a216af 100644 --- a/tests/fuzzing/corpus-cmin/99bottles.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_99bottles.ark @@ -1,10 +1,10 @@ # Lyrics from the song: -# +# # 99 bottles of beer on the wall # 99 bottles of beer # Take one down, pass it around # 98 bottles of beer on the wall -# +# # 98 bottles of beer on the wall # 98 bottles of beer # Take one down, pass it around diff --git a/tests/fuzzing/corpus-cmin/ackermann.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_ackermann.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/ackermann.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_ackermann.ark diff --git a/tests/fuzzing/corpus-cmin/closures.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_closures.ark similarity index 71% rename from tests/fuzzing/corpus-cmin/closures.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_closures.ark index ad3fad155..f818e5632 100644 --- a/tests/fuzzing/corpus-cmin/closures.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_closures.ark @@ -26,3 +26,21 @@ # but john age didn't change, because we created 2 separated closures (print "John's age, didn't change: " john.age) + + + +# Another example to simulate a python range(x, y) + +# this function will return a closure capturing the number given +# and modifying its value each time we'll call the closure, returning +# the new number +(let countdown-from (fun (number) + (fun (&number) { + (set number (- number 1)) + number }))) + +(let countdown-from-3 (countdown-from 3)) + +(print "Countdown " (countdown-from-3)) # 2 +(print "Countdown " (countdown-from-3)) # 1 +(print "Countdown " (countdown-from-3)) # 0 diff --git a/tests/fuzzing/corpus/error.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_error.ark similarity index 93% rename from tests/fuzzing/corpus/error.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_error.ark index c166f9397..9d3c6c96d 100644 --- a/tests/fuzzing/corpus/error.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_error.ark @@ -4,7 +4,7 @@ # it shall be a file in the standard library. (import std.Exceptions) -# the function which should do a "safe number inversion" +# the function which should do a "safe number invertion" (let invert (fun (x) { (if (= x 0) # then diff --git a/tests/fuzzing/corpus-cmin/factorial.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_factorial.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/factorial.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_factorial.ark diff --git a/tests/fuzzing/corpus/macros.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_macros.ark similarity index 99% rename from tests/fuzzing/corpus/macros.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_macros.ark index 7573f6aef..25e9cb3d4 100644 --- a/tests/fuzzing/corpus/macros.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_macros.ark @@ -90,4 +90,4 @@ (+ data "-f4")})) (print "We expected calls to go like this: f1, f2, f3, f4") -(print (-> filename f1 f2 f3 f4)) # (f4 (f3 (f2 (f1 filename)))) \ No newline at end of file +(print (-> filename f1 f2 f3 f4)) # (f4 (f3 (f2 (f1 filename)))) diff --git a/tests/fuzzing/corpus/calls.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_calls.ark similarity index 87% rename from tests/fuzzing/corpus/calls.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_calls.ark index 83269517b..ad1bb90e3 100644 --- a/tests/fuzzing/corpus/calls.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_calls.ark @@ -7,4 +7,4 @@ (list:forEach _listeners (fun (element) (if (= typ (@ element 0)) { ((@ element 1) val) - (set found true)}))) \ No newline at end of file + (set found true)}))) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comment_after_macro_arg.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comment_after_macro_arg.ark new file mode 100644 index 000000000..4af692a60 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comment_after_macro_arg.ark @@ -0,0 +1,5 @@ +($ -> ()#comment +{ + ($if (> (len fn) 0) + (-> (fn1 arg) ...fn) + (fn1 arg))}) diff --git a/tests/fuzzing/corpus-cmin/comment_after_macro_cond.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comment_after_macro_cond.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/comment_after_macro_cond.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comment_after_macro_cond.ark diff --git a/tests/fuzzing/corpus-cmin/comments_after_call.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comments_after_call.ark similarity index 96% rename from tests/fuzzing/corpus-cmin/comments_after_call.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comments_after_call.ark index 900ffb282..aaf982c3a 100644 --- a/tests/fuzzing/corpus-cmin/comments_after_call.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comments_after_call.ark @@ -7,4 +7,4 @@ (foo # func bar # arg egg # arg bis - ) \ No newline at end of file + ) diff --git a/tests/fuzzing/corpus/comments_after_cond.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comments_after_cond.ark similarity index 98% rename from tests/fuzzing/corpus/comments_after_cond.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comments_after_cond.ark index 354d8b907..eafcc3c27 100644 --- a/tests/fuzzing/corpus/comments_after_cond.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comments_after_cond.ark @@ -7,4 +7,4 @@ (if true ok no # dont go -) \ No newline at end of file +) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comments_after_import.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comments_after_import.ark new file mode 100644 index 000000000..014e22008 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comments_after_import.ark @@ -0,0 +1 @@ +(import test) # test diff --git a/tests/fuzzing/corpus-cmin/comments_after_variable.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comments_after_variable.ark similarity index 88% rename from tests/fuzzing/corpus-cmin/comments_after_variable.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comments_after_variable.ark index 635b2074f..24a025e3f 100644 --- a/tests/fuzzing/corpus-cmin/comments_after_variable.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comments_after_variable.ark @@ -2,4 +2,4 @@ ) (mut b 2) # test (set c 3 # value -) # node \ No newline at end of file +) # node diff --git a/tests/fuzzing/corpus-cmin/conditions.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_conditions.ark similarity index 85% rename from tests/fuzzing/corpus-cmin/conditions.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_conditions.ark index d9a58408b..f4095d20e 100644 --- a/tests/fuzzing/corpus-cmin/conditions.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_conditions.ark @@ -7,4 +7,4 @@ (fun () (if true 0 1)) (if # true true true false) -(if (= 1 2) { (foo) (bar) }) \ No newline at end of file +(if (= 1 2) { (foo) (bar) }) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_del.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_del.ark new file mode 100644 index 000000000..ed7fda742 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_del.ark @@ -0,0 +1,3 @@ +(del a) +(del # comment +b) diff --git a/tests/fuzzing/corpus-cmin/field.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_field.ark similarity index 72% rename from tests/fuzzing/corpus-cmin/field.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_field.ark index 12033069b..45e837457 100644 --- a/tests/fuzzing/corpus-cmin/field.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_field.ark @@ -2,4 +2,4 @@ (foo.closure.name # test this.bar.egg.qux) (foo.closure.name this.bar.egg.qux) -(foo.closure.name this.bar.egg.qux 1 2) \ No newline at end of file +(foo.closure.name this.bar.egg.qux 1 2) diff --git a/tests/fuzzing/corpus/functions.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_functions.ark similarity index 96% rename from tests/fuzzing/corpus/functions.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_functions.ark index 884dd5d96..5ee5366c0 100644 --- a/tests/fuzzing/corpus/functions.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_functions.ark @@ -16,4 +16,4 @@ a b # capture &c) # body - {}) \ No newline at end of file + {}) diff --git a/tests/fuzzing/corpus-cmin/imports.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_imports.ark similarity index 97% rename from tests/fuzzing/corpus-cmin/imports.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_imports.ark index a7df9339a..882a321ef 100644 --- a/tests/fuzzing/corpus-cmin/imports.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_imports.ark @@ -10,4 +10,4 @@ foo) (import std.foo # item :a # item -:b) \ No newline at end of file +:b) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_macro_cond.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_macro_cond.ark new file mode 100644 index 000000000..1b0770052 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_macro_cond.ark @@ -0,0 +1,2 @@ +($ -> (arg fn1 ...fn) { + ($if (> (len fn) 0) (-> (fn1 arg) ...fn) (fn1 arg))}) diff --git a/tests/fuzzing/corpus-cmin/macros2.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_macros.ark similarity index 95% rename from tests/fuzzing/corpus-cmin/macros2.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_macros.ark index e156af823..70bb67bcd 100644 --- a/tests/fuzzing/corpus-cmin/macros2.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_macros.ark @@ -3,4 +3,4 @@ ($ defun (name args body) (let name (fun args body))) ($ one (...args) (print "Macro 'one', returns the 2nd argument given in " args " => " (@ args 1))) ($undef a) -($repr a) \ No newline at end of file +($repr a) diff --git a/tests/fuzzing/corpus-cmin/vars.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_vars.ark similarity index 71% rename from tests/fuzzing/corpus-cmin/vars.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_vars.ark index 9c0963687..666d3ab5b 100644 --- a/tests/fuzzing/corpus-cmin/vars.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_vars.ark @@ -5,4 +5,4 @@ (let d 5) (+ 5 d) }) -(let e (fun (f g) (+ f g))) \ No newline at end of file +(let e (fun (f g) (+ f g))) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_huge_number.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_huge_number.ark new file mode 100644 index 000000000..fb45eb3d7 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_huge_number.ark @@ -0,0 +1 @@ +(let a 1e+4932) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_arguments.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_arguments.ark new file mode 100644 index 000000000..3cf56caa1 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_arguments.ark @@ -0,0 +1 @@ +(fun (a diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_begin.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_begin.ark new file mode 100644 index 000000000..4ea298eb6 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_begin.ark @@ -0,0 +1 @@ +{ a b (let c d) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_call.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_call.ark new file mode 100644 index 000000000..da0f7aa55 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_call.ark @@ -0,0 +1 @@ +(a b c (if (ok true) 1 2) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_del.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_del.ark new file mode 100644 index 000000000..7124b08df --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_del.ark @@ -0,0 +1 @@ +(del) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_fun.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_fun.ark new file mode 100644 index 000000000..f45c56655 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_fun.ark @@ -0,0 +1 @@ +(fun (a b &c)) diff --git a/tests/fuzzing/corpus-cmin/incomplete_if.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_if.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/incomplete_if.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_if.ark diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_import_1.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_import_1.ark new file mode 100644 index 000000000..477eec265 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_import_1.ark @@ -0,0 +1 @@ +(import) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_import_2.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_import_2.ark new file mode 100644 index 000000000..42e8c20f6 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_import_2.ark @@ -0,0 +1 @@ +(import a. ) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_let.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_let.ark new file mode 100644 index 000000000..13359f5b5 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_let.ark @@ -0,0 +1,2 @@ +( +let diff --git a/tests/fuzzing/corpus-cmin/incomplete_list.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_list.ark similarity index 50% rename from tests/fuzzing/corpus-cmin/incomplete_list.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_list.ark index a67d2c30e..ddd4ceb69 100644 --- a/tests/fuzzing/corpus-cmin/incomplete_list.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_list.ark @@ -1,3 +1,3 @@ [ 1 - 2 3 \ No newline at end of file + 2 3 diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_macro.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_macro.ark new file mode 100644 index 000000000..46261cd9f --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_macro.ark @@ -0,0 +1 @@ +($ (a) a) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_macro_arguments.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_macro_arguments.ark new file mode 100644 index 000000000..88c585efa --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_macro_arguments.ark @@ -0,0 +1 @@ +($ foo (a diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_macro_spread.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_macro_spread.ark new file mode 100644 index 000000000..93f9f2946 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_macro_spread.ark @@ -0,0 +1 @@ +($ foo (bar ...) (bar)) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_package_name.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_package_name.ark new file mode 100644 index 000000000..717a03299 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_package_name.ark @@ -0,0 +1 @@ +(import a.b. diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_string.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_string.ark new file mode 100644 index 000000000..60c5aa2e5 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_string.ark @@ -0,0 +1 @@ +(let a "1 2 3) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incorrect_arg_capture.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incorrect_arg_capture.ark new file mode 100644 index 000000000..32694139f --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incorrect_arg_capture.ark @@ -0,0 +1 @@ +(fun (a &b c) 1) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incorrect_import.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incorrect_import.ark new file mode 100644 index 000000000..3e8333238 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incorrect_import.ark @@ -0,0 +1 @@ +(import a.b :c:*) diff --git a/tests/fuzzing/corpus-cmin/invalid.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_invalid.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/invalid.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_invalid.ark diff --git a/tests/fuzzing/corpus-cmin/begin.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_begin.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/begin.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_begin.ark diff --git a/tests/fuzzing/corpus/call.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_call.ark similarity index 98% rename from tests/fuzzing/corpus/call.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_call.ark index d904227a2..9d1b8692e 100644 --- a/tests/fuzzing/corpus/call.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_call.ark @@ -12,4 +12,4 @@ func# A foo ) ) -) \ No newline at end of file +) diff --git a/tests/fuzzing/corpus-cmin/closure.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_closure.ark similarity index 70% rename from tests/fuzzing/corpus-cmin/closure.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_closure.ark index ff7c4c693..59a65426f 100644 --- a/tests/fuzzing/corpus-cmin/closure.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_closure.ark @@ -2,4 +2,4 @@ (fun (&a #jk &b) 2) (fun (a &b) 3) -(fun (a b &c &d) 4) \ No newline at end of file +(fun (a b &c &d) 4) diff --git a/tests/fuzzing/corpus/comments.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_comments.ark similarity index 79% rename from tests/fuzzing/corpus/comments.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_comments.ark index e1bcc8c3a..decf89476 100644 --- a/tests/fuzzing/corpus/comments.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_comments.ark @@ -4,4 +4,4 @@ ##) -#))(()) \ No newline at end of file +#))(()) diff --git a/tests/fuzzing/corpus-cmin/del.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_del.ark similarity index 96% rename from tests/fuzzing/corpus-cmin/del.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_del.ark index d636c7d06..f16879b4c 100644 --- a/tests/fuzzing/corpus-cmin/del.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_del.ark @@ -12,4 +12,4 @@ (#r del d #"" -) \ No newline at end of file +) diff --git a/tests/fuzzing/corpus-cmin/fields.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_fields.ark similarity index 86% rename from tests/fuzzing/corpus-cmin/fields.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_fields.ark index 4cfe33f5f..f6980d23b 100644 --- a/tests/fuzzing/corpus-cmin/fields.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_fields.ark @@ -4,4 +4,4 @@ hi.jk) l.m n.o.p) (while q.r s.t) (fun () u.v) -(begin x.y.z) \ No newline at end of file +(begin x.y.z) diff --git a/tests/fuzzing/corpus/fun.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_fun.ark similarity index 98% rename from tests/fuzzing/corpus/fun.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_fun.ark index b60906ca7..b387679b7 100644 --- a/tests/fuzzing/corpus/fun.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_fun.ark @@ -24,4 +24,4 @@ dddd (fun () ()) (fun (a) ( # test -)) \ No newline at end of file +)) diff --git a/tests/fuzzing/corpus-cmin/if.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_if.ark similarity index 84% rename from tests/fuzzing/corpus-cmin/if.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_if.ark index 69ef18122..ec05a11ab 100644 --- a/tests/fuzzing/corpus-cmin/if.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_if.ark @@ -15,4 +15,4 @@ (if 3 ()) (if (func a b) a b) -(if (a b c) (d e) (f)) \ No newline at end of file +(if (a b c) (d e) (f)) diff --git a/tests/fuzzing/corpus/import.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_import.ark similarity index 99% rename from tests/fuzzing/corpus/import.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_import.ark index 113e011d1..e7578bd1c 100644 --- a/tests/fuzzing/corpus/import.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_import.ark @@ -13,4 +13,4 @@ foo.bar.egg # end of line (import foo.bar # cool package :a # a nice symbol :b# another symbol we need -) \ No newline at end of file +) diff --git a/tests/fuzzing/corpus-cmin/let_atom.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_let_atom.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/let_atom.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_let_atom.ark diff --git a/tests/fuzzing/corpus/list.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_list.ark similarity index 89% rename from tests/fuzzing/corpus/list.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_list.ark index 33931ac01..f10f020e2 100644 --- a/tests/fuzzing/corpus/list.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_list.ark @@ -6,4 +6,4 @@ 1 #end ] -[[1 a]] \ No newline at end of file +[[1 a]] diff --git a/tests/fuzzing/corpus/loop.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_loop.ark similarity index 64% rename from tests/fuzzing/corpus/loop.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_loop.ark index 168c292b3..10f3a0d71 100644 --- a/tests/fuzzing/corpus/loop.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_loop.ark @@ -11,4 +11,4 @@ while ( # 123 # 456 while 3 3 ) -(while (isGood 1) (doStuff a (if b c d))) \ No newline at end of file +(while (isGood 1) (doStuff a (if b c d))) diff --git a/tests/fuzzing/corpus/macro.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_macro.ark similarity index 93% rename from tests/fuzzing/corpus/macro.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_macro.ark index 180ab33a2..1e224b4a6 100644 --- a/tests/fuzzing/corpus/macro.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_macro.ark @@ -15,4 +15,4 @@ e ($ k (l ...m) (print l m)) ($ n ( ...p -) (print p)) \ No newline at end of file +) (print p)) diff --git a/tests/fuzzing/corpus-cmin/numbers.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_numbers.ark similarity index 81% rename from tests/fuzzing/corpus-cmin/numbers.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_numbers.ark index 8475fd064..470eef9b8 100644 --- a/tests/fuzzing/corpus-cmin/numbers.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_numbers.ark @@ -4,4 +4,4 @@ (let d 1e4) (let e 2e+8) (let f 4e-16) -(let g 8.91e-31) \ No newline at end of file +(let g 8.91e-31) diff --git a/tests/fuzzing/corpus-cmin/strings.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_strings.ark similarity index 53% rename from tests/fuzzing/corpus-cmin/strings.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_strings.ark index 0a83b60e0..b5f461c0a 100644 --- a/tests/fuzzing/corpus-cmin/strings.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_strings.ark @@ -1,2 +1,2 @@ (print "abc" "123\"test") -(print "\\ 123aéoÒ") \ No newline at end of file +(print "\\ 123aéoÒ") diff --git a/tests/fuzzing/corpus-cmin/text b/tests/fuzzing/corpus-cmin/text new file mode 100644 index 000000000..9dd561fdb --- /dev/null +++ b/tests/fuzzing/corpus-cmin/text @@ -0,0 +1 @@ +hello, world0 diff --git a/tests/fuzzing/corpus-cmin/unbound_capture.ark b/tests/fuzzing/corpus-cmin/unbound_capture.ark deleted file mode 100644 index 71de9f029..000000000 --- a/tests/fuzzing/corpus-cmin/unbound_capture.ark +++ /dev/null @@ -1 +0,0 @@ -(mut d (fun (&d) (print d))) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/utf8.ark b/tests/fuzzing/corpus-cmin/utf8.ark deleted file mode 100644 index 7f5a1fcc9..000000000 --- a/tests/fuzzing/corpus-cmin/utf8.ark +++ /dev/null @@ -1,28 +0,0 @@ -(let foo (fun (a b) ())) -(let bar (fun (a) ())) - -(let ---> 15) -(foo ---> 15) - -(let <-- 16) -(foo <-- 16) -(bar (< ---> <--)) - -(let emotes [ - "🥳" "😅" "😥" "👿" "🟢" "🙊" - "💡" "💻" "🌟" "🔹" "🌐" "🤖" - "🖐" "🤔" "🤩" "🤠" "😊"]) -(mut i 0) -(while (< i (len emotes)) { - (foo (len (@ emotes i)) 4) - (set i (+ 1 i)) }) - -(foo "\U0001f47f" "👿") -(foo "\U0001F47F" "👿") -(foo "\u1e0b" "ḋ") -(foo "\u1E0B" "ḋ") - -(foo (str:ord "👺") 128122) -(foo (str:chr 128122) "👺") -(foo (str:ord "$") 36) -(foo (str:chr 36) "$") diff --git a/tests/fuzzing/corpus/async_test.ark b/tests/fuzzing/corpus/async_test.ark deleted file mode 100644 index cf8540394..000000000 --- a/tests/fuzzing/corpus/async_test.ark +++ /dev/null @@ -1,29 +0,0 @@ -(import std.List) - -(let foo (fun (a b) (+ a b))) -(let async-foo (async foo 1 2)) - -(let size 1000) -(let data (list:fill size 1)) - -(let sum (fun (a b src) { - (mut acc 0) - (while (< a b) { - (set acc (+ acc (@ src a))) - (set a (+ 1 a))}) - acc })) - -(print (type async-foo) "UserType") -(print (await async-foo) 3) -(let start-non-async (time)) -(let res-non-async (sum 0 size data)) -(let time-non-async (- (time) start-non-async)) -(let start-async (time)) -(let workers [ - (async sum 0 (/ size 4) data) - (async sum (/ size 4) (/ size 2) data) - (async sum (/ size 2) (- size (/ size 4)) data) - (async sum (- size (/ size 4)) size data)]) -(let res-async (list:reduce (list:map workers (fun (w) (await w))) (fun (a b) (+ a b)))) -(let time-async (- (time) start-async)) -(print time-async) diff --git a/tests/fuzzing/corpus/builtins-list.ark b/tests/fuzzing/corpus/builtins-list.ark deleted file mode 100644 index 09da39f07..000000000 --- a/tests/fuzzing/corpus/builtins-list.ark +++ /dev/null @@ -1,20 +0,0 @@ -(let base-list [1 2 3]) -(let base-list-enhanced (concat base-list [4 5])) - -(let foo (fun (a b) ())) - -(foo (append (append base-list 4) 5) base-list-enhanced) -(foo (concat base-list [4 5]) base-list-enhanced) -(foo (type []) "List") -(foo (list:reverse base-list) [3 2 1]) -(foo (list:reverse []) []) -(foo (list:find [] nil) -1) -(foo (list:find [12] 12) 0) -(foo (list:find [1 2 3] 2) 1) -(foo (list:find [12] nil) -1) -(foo (list:slice base-list-enhanced 0 3 1) base-list) -(foo (list:slice base-list-enhanced 0 1 1) [1]) -(foo (list:slice base-list-enhanced 0 3 2) [1 3]) -(foo (list:sort [5 4 3 2 1]) [1 2 3 4 5]) -(foo (list:sort [5]) [5]) -(foo (list:sort []) []) \ No newline at end of file diff --git a/tests/fuzzing/corpus/builtins-str.ark b/tests/fuzzing/corpus/builtins-str.ark deleted file mode 100644 index 3366d6aa9..000000000 --- a/tests/fuzzing/corpus/builtins-str.ark +++ /dev/null @@ -1,10 +0,0 @@ -(let foo (fun (a b) ())) - -(foo (str:find "abc" "d") -1) -(foo (str:find "abc" "a") 0) -(foo (str:find "abc" "bc") 1) -(foo (str:find "abcdefghijkl" "defijkl") -1) -(foo (str:find "abcdefghijkl" "defghijkl") 3) -(foo (str:removeAt "abcdefghijkl" 3) "abcefghijkl") -(foo (str:removeAt "abcdefghijkl" 0) "bcdefghijkl") -(foo (str:removeAt "abcdefghijkl" 11) "abcdefghijk") \ No newline at end of file diff --git a/tests/fuzzing/corpus/closures2.ark b/tests/fuzzing/corpus/closures2.ark deleted file mode 100644 index fb961813d..000000000 --- a/tests/fuzzing/corpus/closures2.ark +++ /dev/null @@ -1,15 +0,0 @@ -# Another example to simulate a python range(x, y) - -# this function will return a closure capturing the number given -# and modifying its value each time we'll call the closure, returning -# the new number -(let countdown-from (fun (number) - (fun (&number) { - (set number (- number 1)) - number }))) - -(let countdown-from-3 (countdown-from 3)) - -(print "Countdown " (countdown-from-3)) # 2 -(print "Countdown " (countdown-from-3)) # 1 -(print "Countdown " (countdown-from-3)) # 0 diff --git a/tests/fuzzing/corpus/comments_after_import.ark b/tests/fuzzing/corpus/comments_after_import.ark deleted file mode 100644 index 1de571d8b..000000000 --- a/tests/fuzzing/corpus/comments_after_import.ark +++ /dev/null @@ -1 +0,0 @@ -(import test) # test \ No newline at end of file diff --git a/tests/fuzzing/corpus/comments_after_while.ark b/tests/fuzzing/corpus/comments_after_while.ark deleted file mode 100644 index 04f9830a8..000000000 --- a/tests/fuzzing/corpus/comments_after_while.ark +++ /dev/null @@ -1,7 +0,0 @@ -(while false # cond - 1 # body - ) - - -(while false {} # no body -) # infinite loop \ No newline at end of file diff --git a/tests/fuzzing/corpus/empty.ark b/tests/fuzzing/corpus/empty.ark deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/fuzzing/corpus/99bottles.ark b/tests/fuzzing/corpus/examples_99bottles.ark similarity index 98% rename from tests/fuzzing/corpus/99bottles.ark rename to tests/fuzzing/corpus/examples_99bottles.ark index 03f599f99..d96a216af 100644 --- a/tests/fuzzing/corpus/99bottles.ark +++ b/tests/fuzzing/corpus/examples_99bottles.ark @@ -1,10 +1,10 @@ # Lyrics from the song: -# +# # 99 bottles of beer on the wall # 99 bottles of beer # Take one down, pass it around # 98 bottles of beer on the wall -# +# # 98 bottles of beer on the wall # 98 bottles of beer # Take one down, pass it around diff --git a/tests/fuzzing/corpus/ackermann.ark b/tests/fuzzing/corpus/examples_ackermann.ark similarity index 100% rename from tests/fuzzing/corpus/ackermann.ark rename to tests/fuzzing/corpus/examples_ackermann.ark diff --git a/tests/fuzzing/corpus/examples_blockchain.ark b/tests/fuzzing/corpus/examples_blockchain.ark new file mode 100644 index 000000000..04af95fe5 --- /dev/null +++ b/tests/fuzzing/corpus/examples_blockchain.ark @@ -0,0 +1,168 @@ +(import std.hash) +(import std.http) +(import std.json) + +(import std.Range) +(import std.List) + +# define what an ArkCoin block is +(let make:block (fun (index timestamp data previous_hash) { + (let hash (hash:sha256 (+ (toString index) (toString (math:floor timestamp)) (json:toString data) previous_hash))) + (print "made block " hash) + (fun (&index ×tamp &data &previous_hash &hash) ())})) + +(let make:block:fromJSON (fun (data) + (make:block (json:get data "index") + (json:get data "timestamp") + (json:get data "data") + (json:get data "hash")))) + +# generate genesis block +(let make:genesis_block (fun () + (make:block 0 (time) (json:fromList [ + "type" "Genesis block" + "proof-of-work" 1 + ]) "deadbeef"))) + +# let the user add their miner address if we can't find it +(let miner_address (if (not (io:fileExists? "miner.address")) + (input "miner address> ") + (io:readFile "miner.address"))) +(io:writeFile "miner.address" miner_address) +# this node's blockchain copy +(mut blockchain (list (make:genesis_block))) +# storing the transactions that this node has +(mut nodes_transactions []) +# storing the url data of every other node in the network so we can talk with them +(mut peer_nodes []) +# magic number for the proof of work +(let magic 12) + +(let find_new_chains (fun () { + (print "finding new chains") + + # get the blockchains of every other node + (mut other_chains []) + (list:forEach peer_nodes (fun (url) { + (let cli (http:client:create url 80)) + (let tmp (http:client:get cli "/")) + (if (not (nil? tmp)) + { + (let content (make:block:fromJSON (json:fromString (@ tmp 1)))) + (set other_chains (append other_chains content))}) + (del cli)})) + other_chains })) + +(let verify_proof_of_work (fun (proof last_proof) + (and (> proof last_proof) (= 0 (mod proof magic)) (= 0 (mod proof last_proof))))) + +(let verify_chain (fun (chain) { + (print "verifying chain") + + (mut previous nil) + (mut ok? true) + (list:forEach chain (fun (block) { + # no need to continue checking the blocks if a block wasn't ok + (if (and ok? (not (nil? previous))) + (set ok? (verify_proof_of_work (json:get block.data "proof-of-work") (json:get previous.data "proof-of-work")))) + (set previous block)})) + ok? })) + +(let consensus (fun () { + (print "consensus running") + + (let other_chains (find_new_chains)) + # if our chain isn't longest, then we store the longest + (list:forEach other_chains (fun (chain) { + (if (and (< (len blockchain) (len chain)) (verify_chain chain)) + (set blockchain chain))}))})) + +(let proof_of_work (fun (last_proof) { + (print "proof of work being generated") + + (mut inc (+ 1 last_proof)) + # keep incrementing until it's equal to a number divisible by 12 and + # the proof of work of the previous block in the chain + (while (not (and (= 0 (mod inc magic))) (= 0 (mod inc last_proof))) + (set inc (+ 1 inc))) + inc })) + +(let srv (http:server:create)) +(http:server:post srv "/transaction" (fun (request) { + (print "posting block " request) + + # on each post request, extract transaction data + (let new (json:fromString request)) + (set nodes_transactions (append nodes_transactions new)) + (print "New transaction") + (print (str:format "FROM: {}" (json:get new "from"))) + (print (str:format "TO: {}" (json:get new "to"))) + (print (str:format "AMOUNT: {}" (json:get new "amount"))) + + # return value + [200 "transaction submission successful" "text/plain"]})) + +(http:server:get srv "/blocks" (fun (_) { + (print "fetching blocks") + + (consensus) + (mut to_send []) + (list:forEach blockchain (fun (data) { + (set to_send (append to_send (json:fromList [ + "index" data.index + "timestamp" data.timestamp + "data" data.data + "hash" data.hash])))})) + + (mut str (toString (@ to_send 0))) + (list:forEach (tail to_send) (fun (e) + (set str (+ str ", " (toString e))))) + + [200 (+ "{\"chain\": [" str "]}") "application/json"]})) + +(http:server:get srv "/mine" (fun (data) { + (print "mining block") + (print (type data)) + (if (not (nil? data)) + (print (http:params:toList data))) + (set data "") + + (let last_block (@ blockchain -1)) + (let last_proof (json:get last_block.data "proof-of-work")) + # find the proof of work for the current block being mined + # the program will hang here until a new proof of work is found + (let proof (proof_of_work last_proof)) + # once we have the proof of work, we can mine a block so we reward the miner by adding a transaction + (set nodes_transactions (append nodes_transactions (json:fromList + [ + "from" "network" + "to" miner_address + "amount" 1]))) + (print "make block") + # gather the data needed to create a new block + (mut new_block (make:block + (+ 1 last_block.index) + (time) + (json:fromList + [ + "proof-of-work" proof + "transactions" nodes_transactions + "content" data ]) + last_block.hash)) + + (set blockchain (append blockchain new_block)) + # empty transactions list + (set nodes_transactions []) + + [ + 200 + (+ "{" + "\"index\": " (toString new_block.index) "," + "\"timestamp\": " (toString new_block.timestamp) "," + "\"data\": " (toString new_block.data) "," + "\"hash\": \"" (toString new_block.hash) "\"" + "}") + "application/json"]})) + +(print "Listening on localhost:80 for miner " miner_address) +(http:server:listen srv "localhost" 80) diff --git a/tests/fuzzing/corpus/callbacks.ark b/tests/fuzzing/corpus/examples_callbacks.ark similarity index 100% rename from tests/fuzzing/corpus/callbacks.ark rename to tests/fuzzing/corpus/examples_callbacks.ark diff --git a/tests/fuzzing/corpus/closures.ark b/tests/fuzzing/corpus/examples_closures.ark similarity index 71% rename from tests/fuzzing/corpus/closures.ark rename to tests/fuzzing/corpus/examples_closures.ark index ad3fad155..f818e5632 100644 --- a/tests/fuzzing/corpus/closures.ark +++ b/tests/fuzzing/corpus/examples_closures.ark @@ -26,3 +26,21 @@ # but john age didn't change, because we created 2 separated closures (print "John's age, didn't change: " john.age) + + + +# Another example to simulate a python range(x, y) + +# this function will return a closure capturing the number given +# and modifying its value each time we'll call the closure, returning +# the new number +(let countdown-from (fun (number) + (fun (&number) { + (set number (- number 1)) + number }))) + +(let countdown-from-3 (countdown-from 3)) + +(print "Countdown " (countdown-from-3)) # 2 +(print "Countdown " (countdown-from-3)) # 1 +(print "Countdown " (countdown-from-3)) # 0 diff --git a/tests/fuzzing/corpus/collatz.ark b/tests/fuzzing/corpus/examples_collatz.ark similarity index 100% rename from tests/fuzzing/corpus/collatz.ark rename to tests/fuzzing/corpus/examples_collatz.ark diff --git a/tests/fuzzing/corpus/examples_counter.ark b/tests/fuzzing/corpus/examples_counter.ark new file mode 100644 index 000000000..351c3f4d6 --- /dev/null +++ b/tests/fuzzing/corpus/examples_counter.ark @@ -0,0 +1,8 @@ +(puts "\t\tHello world\nHere is a counter: ") +(mut i 0) +(while (<= i 100) { + # puts doesn't put a \n at the end of the string + (puts "\rHere is a counter: " i "/100") + (set i (+ 1 i)) + # sleep for 50ms + (sys:sleep 50)}) diff --git a/tests/fuzzing/corpus-cmin/error.ark b/tests/fuzzing/corpus/examples_error.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/error.ark rename to tests/fuzzing/corpus/examples_error.ark diff --git a/tests/fuzzing/corpus/factorial.ark b/tests/fuzzing/corpus/examples_factorial.ark similarity index 100% rename from tests/fuzzing/corpus/factorial.ark rename to tests/fuzzing/corpus/examples_factorial.ark diff --git a/tests/fuzzing/corpus/fibo.ark b/tests/fuzzing/corpus/examples_fibo.ark similarity index 100% rename from tests/fuzzing/corpus/fibo.ark rename to tests/fuzzing/corpus/examples_fibo.ark diff --git a/tests/fuzzing/corpus/examples_games_game_of_life.ark b/tests/fuzzing/corpus/examples_games_game_of_life.ark new file mode 100644 index 000000000..c623b8750 --- /dev/null +++ b/tests/fuzzing/corpus/examples_games_game_of_life.ark @@ -0,0 +1,69 @@ +(let board [ + 0 0 0 0 + 0 1 1 1 + 1 1 1 0 + 0 0 0 0]) +(let width 4) +(let height 4) +(let dead 0) +(let alive 1) + +(let get (fun (board_ i width height) + (if (and (>= i 0) (< i (* width height))) + (@ board_ i) + dead ))) + +(let neigh (fun (board_ index width height) { + (let x (math:floor (mod index width))) + (let y (math:floor (/ index width))) + (mut count 0) + + (if (>= (- y 1) 0) + (set count (+ count (get board_ (- index width) width height)))) + (if (< (+ y 1) height) + (set count (+ count (get board_ (+ index width) width height)))) + (if (>= (- x 1) 0) + (set count (+ count (get board_ (- index 1) width height)))) + (if (< (+ x 1) width) + (set count (+ count (get board_ (+ index 1) width height)))) + + (if (and (>= (- x 1) 0) (>= (- y 1) 0)) + (set count (+ count (get board_ (- index 1 width) width height)))) + (if (and (< (+ x 1) width) (< (+ y 1) height)) + (set count (+ count (get board_ (+ index width 1) width height)))) + (if (and (>= (- x 1) 0) (< (+ y 1) height)) + (set count (+ count (get board_ (+ index width -1) width height)))) + (if (and (< (+ x 1) width) (>= (- y 1) 0)) + (set count (+ count (get board_ (- index width -1) width height)))) + + count })) + +(mut copy (list:fill (* height width) dead)) +(mut i 0) +(while (< i (* width height)) { + (mut neighs (neigh board i width height)) + (if (= 3 neighs) + (set copy (list:setAt copy i alive))) + (if (= 2 neighs) + (set copy (list:setAt copy i (@ board i)))) + (if (or (< neighs 2) (> neighs 3)) + (set copy (list:setAt copy i dead))) + + (set i (+ 1 i)) }) + +(let display (fun (board width height) { + (mut i 0) + (while (< i (* width height)) { + (mut y (math:floor (/ i width))) + (mut x (math:floor (mod i width))) + + (if (= 0 x) (puts "\n")) + (if (= alive (@ board i)) (puts "x") (puts " ")) + + (set i (+ 1 i)) }) + (puts "\n") })) + +(print "initial board:") +(display board width height) +(print "new board:") +(display copy width height) diff --git a/tests/fuzzing/corpus/examples_games_snake_snake.ark b/tests/fuzzing/corpus/examples_games_snake_snake.ark new file mode 100644 index 000000000..44c593ac7 --- /dev/null +++ b/tests/fuzzing/corpus/examples_games_snake_snake.ark @@ -0,0 +1,208 @@ +(import std.sf") +(import std.Exceptions) +(import std.Switch) + +(sf:window:init 600 600 "ArkSnake") +(sf:window:setFPS 60) + +# stuff needed for the texts +(let font (sf:load:font "FreeSansBold.ttf")) +(let fps_text (sf:text:make font "FPS: NaN" 18 [255 255 255])) +(sf:set:pos fps_text (/ (- 600 (sf:width fps_text)) 2) 580) + +# the board object +# 0 => empty, 1 => apple +(let create-board-object (fun () { + # sprites used for the game + (let apple_texture (sf:load:texture "apple.png")) + (let apple_sprite (sf:load:sprite apple_texture)) + + (mut data []) + { + (mut _y 0) + + (while (!= _y 20) { + (mut _x 0) + (mut line []) + + (while (!= _x 20) { + (mut t 0) # empty + (if (or (and (= _y 10) (= _x 5)) (or (and (= _y 5) (= _x 2)) (and (= _y 12) (= _x 12)))) + (set t 1) + (set t 0)) + (set line (append line t)) + (set _x (+ 1 _x)) + }) + + (set data (append data line)) + (set _y (+ 1 _y)) + }) + } + + (let draw_board (fun () { + (mut y 0) + (while (!= y 20) { + (mut x 0) + (while (!= x 20) { + (mut case (@ (@ data y) x)) + (if (= case 1) + { + (sf:set:pos apple_sprite (* 20 x) (* 20 y)) + (sf:draw apple_sprite) + }) + (set x (+ x 1)) + }) + (set y (+ 1 y)) + }) + + # ret + nil + })) + + (let has_apple_left? (fun () { + (mut apple_left 0) + (mut y 0) + (while (!= y 20) { + (mut x 0) + (while (!= x 20) { + (mut case (@ (@ data y) x)) + (if (= case 1) + (set apple_left (+ 1 apple_left))) + (set x (+ x 1)) + }) + (set y (+ 1 y)) + }) + + # ret + apple_left + })) + + (let eat_apple_at (fun (x y) + (if (and (and (>= x 0) (>= y 0)) (and (< y 20) (< x 20))) + { + (let test (= 1 (@ (@ data y) x))) + (if test + # remove apple + { + (mut _y 0) + (mut _data []) + + (while (!= _y 20) { + (mut _x 0) + (mut line []) + + (if (= _y y) + (while (!= _x 20) { + (mut case (@ (@ data _y) _x)) + (if (= _x x) (set case 0) ()) + (set line (append line case)) + (set _x (+ 1 _x)) + }) + (set line (@ data _y))) + + (set _data (append _data line)) + (set _y (+ 1 _y)) + }) + + (set data _data) + } + ()) + (return test) + } + (throw "Out of bounds")) + )) + + (fun (&data &apple_sprite &draw_board &has_apple_left? &eat_apple_at) ()) +})) + +# instanciating +(let board (create-board-object)) + +# the snake +(let create-snake-object (fun () { + (mut pos [[0 0]]) + (mut should_move true) + (mut last_direction [1 0]) # right + (let snake_texture (sf:load:texture "snake.png")) + (let snake_sprite (sf:load:sprite snake_texture)) + + (let move (fun (mx my board) { + # we don't need to move since this function was called explicitly + (set should_move false) + (set last_direction [mx my]) + + (let p (@ pos (- (len pos) 1))) + + (try (board.eat_apple_at (+ mx (@ p 0)) (+ my (@ p 1))) + (fun (result) { + # if result == false, move the tail to the head + # otherwise, add a new head + (set pos (append pos [(+ mx (@ p 0)) (+ my (@ p 1))])) + (if (not result) + (if (!= 0 (len pos)) + # then + (set pos (tail pos)))) + }) + (fun (err) ())) + })) + + (let reset_auto_move (fun () (set should_move true))) + + (let auto_move (fun (board) { + (move (@ last_direction 0) (@ last_direction 1) board)})) + + (let draw (fun () { + (mut acc 0) + (while (!= acc (len pos)) { + (mut current (@ pos acc)) + (sf:set:pos snake_sprite (* 20 (@ current 0)) (* 20 (@ current 1))) + (sf:draw snake_sprite) + (set acc (+ 1 acc)) + }) + })) + + (fun (&move &reset_auto_move &auto_move &draw &pos &should_move &last_direction &snake_sprite) ()) +})) + +# instanciating +(let snake (create-snake-object)) +(mut frame 0) + +(while (sf:window:open?) { + (mut frame_start (time)) + + # event handling + (snake.reset_auto_move) + (mut event (sf:pollEvent)) + + (switch event [ + [(sf:event "quit") (fun () (sf:window:close))] + [(sf:event "keyup" "up") (fun () (snake.move 0 -1 board))] + [(sf:event "keyup" "down") (fun () (snake.move 0 1 board))] + [(sf:event "keyup" "right") (fun () (snake.move 1 0 board))] + [(sf:event "keyup" "left") (fun () (snake.move -1 0 board))] + ]) + + # update + (if (= 0 (board.has_apple_left?)) + { + (print "you win!") + (sf:window:close) + }) + + (if (= 0 (mod frame 20)) + (snake.auto_move board)) + (set frame (+ 1 frame)) + + # rendering + (sf:window:clear 0 0 0) + (board.draw_board) # draw board first + (snake.draw) # then snake + (sf:draw fps_text) + (sf:window:display) # double buffering + + (mut diff (- (time) frame_start)) + (if (!= diff 0) + (sf:text:set fps_text (+ "FPS: " (toString (/ 1 diff)))) + (sf:text:set fps_text "FPS: NaN")) +}) diff --git a/tests/fuzzing/corpus/examples_http.ark b/tests/fuzzing/corpus/examples_http.ark new file mode 100644 index 000000000..93051300c --- /dev/null +++ b/tests/fuzzing/corpus/examples_http.ark @@ -0,0 +1,52 @@ +# here we import the http module of the standard library +(import std.http) + +# a toggle to try the client and the server +(let server false) + +(if server + # then, server + { + # we can have only 1 server at a time + (let srv (http:server:create)) + # the handler answering requests on a given route, here /hi + (let f (fun (data) { + [ + 200 + (if (nil? data) + "hello world" + (+ "hello, " (toString (http:params:toList data)))) + "text/plain" + ]})) + # configure the route and the handler, we can also give a string instead of a function + (http:server:get srv "/hi" f) + (print "starting on localhost:80") + # make the server listen forever on the port 80 + (http:server:listen srv "localhost" 80)} + # else, client + { + # we give the website and the port + (let cli (http:client:create "monip.org" 80)) + + # we get a route on a given client + (mut output (http:client:get cli "/")) + # if we got nil, then we couldn't reach the destination + (if (nil? output) + (print "couldn't reach the server") + (print output)) + + # we can create multiple clients at the same time + (let cli2 (http:client:create "yahoo.com" 80)) + + (set output (http:client:get cli2 "/")) + # the function returns a list: [code content] + (print (@ output 0)) # status: 301 + + # follow redirections + (http:client:setFollowLocation cli2 true) + # and retry + (set output (http:client:get cli2 "/")) + # it should work now + (if (nil? output) + (print "error") + (print (@ output 0)))}) # status: 200 diff --git a/tests/fuzzing/corpus-cmin/macros.ark b/tests/fuzzing/corpus/examples_macros.ark similarity index 99% rename from tests/fuzzing/corpus-cmin/macros.ark rename to tests/fuzzing/corpus/examples_macros.ark index 7573f6aef..25e9cb3d4 100644 --- a/tests/fuzzing/corpus-cmin/macros.ark +++ b/tests/fuzzing/corpus/examples_macros.ark @@ -90,4 +90,4 @@ (+ data "-f4")})) (print "We expected calls to go like this: f1, f2, f3, f4") -(print (-> filename f1 f2 f3 f4)) # (f4 (f3 (f2 (f1 filename)))) \ No newline at end of file +(print (-> filename f1 f2 f3 f4)) # (f4 (f3 (f2 (f1 filename)))) diff --git a/tests/fuzzing/corpus/examples_more-or-less.ark b/tests/fuzzing/corpus/examples_more-or-less.ark new file mode 100644 index 000000000..465c238df --- /dev/null +++ b/tests/fuzzing/corpus/examples_more-or-less.ark @@ -0,0 +1,25 @@ +(import std.random) +(import std.Math) + +(let number (mod (math:abs (random)) 10000)) + +(let game (fun () { + (let impl (fun (tries) { + (let guess (toNumber (input "Input a numeric value: "))) + + (if (< guess number) + { + (print "It's more than " guess) + (impl (+ tries 1))} + (if (= guess number) + { + (print "You found it!") + tries } + { + (print "It's less than " guess) + (impl (+ tries 1))}))})) + + (let tries (impl 0)) + (print "You won in " tries " tries.")})) + +(game) diff --git a/tests/fuzzing/corpus/quicksort.ark b/tests/fuzzing/corpus/examples_quicksort.ark similarity index 92% rename from tests/fuzzing/corpus/quicksort.ark rename to tests/fuzzing/corpus/examples_quicksort.ark index cce3f7ea0..9eedab708 100644 --- a/tests/fuzzing/corpus/quicksort.ark +++ b/tests/fuzzing/corpus/examples_quicksort.ark @@ -35,8 +35,14 @@ # obviously ArkScript will be a bit slower (let bench (fun (name code) { (mut start (time)) - (code) - (let t (* 1000 (- (time) start))) + (let rep 1) + + (mut i 0) + (while (< i rep) { + (code) + (set i (+ 1 i))}) + + (let t (/ (* 1000 (- (time) start)) rep)) (print name " average: " t "ms") t })) diff --git a/tests/fuzzing/corpus/sum_digits.ark b/tests/fuzzing/corpus/examples_sum_digits.ark similarity index 100% rename from tests/fuzzing/corpus/sum_digits.ark rename to tests/fuzzing/corpus/examples_sum_digits.ark diff --git a/tests/fuzzing/corpus/huge_number.ark b/tests/fuzzing/corpus/huge_number.ark deleted file mode 100644 index 337d58921..000000000 --- a/tests/fuzzing/corpus/huge_number.ark +++ /dev/null @@ -1 +0,0 @@ -(let a 1e+4932) \ No newline at end of file diff --git a/tests/fuzzing/corpus/incomplete_arguments.ark b/tests/fuzzing/corpus/incomplete_arguments.ark deleted file mode 100644 index 0ccca6130..000000000 --- a/tests/fuzzing/corpus/incomplete_arguments.ark +++ /dev/null @@ -1 +0,0 @@ -(fun (a \ No newline at end of file diff --git a/tests/fuzzing/corpus/incomplete_begin.ark b/tests/fuzzing/corpus/incomplete_begin.ark deleted file mode 100644 index 46ba98069..000000000 --- a/tests/fuzzing/corpus/incomplete_begin.ark +++ /dev/null @@ -1 +0,0 @@ -{ a b (let c d) \ No newline at end of file diff --git a/tests/fuzzing/corpus/incomplete_call.ark b/tests/fuzzing/corpus/incomplete_call.ark deleted file mode 100644 index 3456820e9..000000000 --- a/tests/fuzzing/corpus/incomplete_call.ark +++ /dev/null @@ -1 +0,0 @@ -(a b c (if (ok true) 1 2) \ No newline at end of file diff --git a/tests/fuzzing/corpus/incomplete_del.ark b/tests/fuzzing/corpus/incomplete_del.ark deleted file mode 100644 index f9748e69c..000000000 --- a/tests/fuzzing/corpus/incomplete_del.ark +++ /dev/null @@ -1 +0,0 @@ -(del) \ No newline at end of file diff --git a/tests/fuzzing/corpus/incomplete_fun.ark b/tests/fuzzing/corpus/incomplete_fun.ark deleted file mode 100644 index aa9983dd8..000000000 --- a/tests/fuzzing/corpus/incomplete_fun.ark +++ /dev/null @@ -1 +0,0 @@ -(fun (a b &c)) \ No newline at end of file diff --git a/tests/fuzzing/corpus/incomplete_import_1.ark b/tests/fuzzing/corpus/incomplete_import_1.ark deleted file mode 100644 index 802f85ecf..000000000 --- a/tests/fuzzing/corpus/incomplete_import_1.ark +++ /dev/null @@ -1 +0,0 @@ -(import) \ No newline at end of file diff --git a/tests/fuzzing/corpus/incomplete_import_2.ark b/tests/fuzzing/corpus/incomplete_import_2.ark deleted file mode 100644 index abe834157..000000000 --- a/tests/fuzzing/corpus/incomplete_import_2.ark +++ /dev/null @@ -1 +0,0 @@ -(import a. ) \ No newline at end of file diff --git a/tests/fuzzing/corpus/incomplete_let.ark b/tests/fuzzing/corpus/incomplete_let.ark deleted file mode 100644 index a5ea45479..000000000 --- a/tests/fuzzing/corpus/incomplete_let.ark +++ /dev/null @@ -1,2 +0,0 @@ -( -let \ No newline at end of file diff --git a/tests/fuzzing/corpus/incomplete_macro.ark b/tests/fuzzing/corpus/incomplete_macro.ark deleted file mode 100644 index d5fa0be09..000000000 --- a/tests/fuzzing/corpus/incomplete_macro.ark +++ /dev/null @@ -1 +0,0 @@ -($ (a) a) \ No newline at end of file diff --git a/tests/fuzzing/corpus/incomplete_macro_arguments.ark b/tests/fuzzing/corpus/incomplete_macro_arguments.ark deleted file mode 100644 index b2a8b4117..000000000 --- a/tests/fuzzing/corpus/incomplete_macro_arguments.ark +++ /dev/null @@ -1 +0,0 @@ -($ foo (a \ No newline at end of file diff --git a/tests/fuzzing/corpus/incomplete_macro_spread.ark b/tests/fuzzing/corpus/incomplete_macro_spread.ark deleted file mode 100644 index 43e48c81b..000000000 --- a/tests/fuzzing/corpus/incomplete_macro_spread.ark +++ /dev/null @@ -1 +0,0 @@ -($ foo (bar ...) (bar)) \ No newline at end of file diff --git a/tests/fuzzing/corpus/incomplete_package_name.ark b/tests/fuzzing/corpus/incomplete_package_name.ark deleted file mode 100644 index 9cd2b6fa4..000000000 --- a/tests/fuzzing/corpus/incomplete_package_name.ark +++ /dev/null @@ -1 +0,0 @@ -(import a.b. \ No newline at end of file diff --git a/tests/fuzzing/corpus/incomplete_string.ark b/tests/fuzzing/corpus/incomplete_string.ark deleted file mode 100644 index b486e33c2..000000000 --- a/tests/fuzzing/corpus/incomplete_string.ark +++ /dev/null @@ -1 +0,0 @@ -(let a "1 2 3) \ No newline at end of file diff --git a/tests/fuzzing/corpus/incorrect_arg_capture.ark b/tests/fuzzing/corpus/incorrect_arg_capture.ark deleted file mode 100644 index 363224f8a..000000000 --- a/tests/fuzzing/corpus/incorrect_arg_capture.ark +++ /dev/null @@ -1 +0,0 @@ -(fun (a &b c) 1) \ No newline at end of file diff --git a/tests/fuzzing/corpus/incorrect_escape_seq.ark b/tests/fuzzing/corpus/incorrect_escape_seq.ark deleted file mode 100644 index 179f7d04b..000000000 --- a/tests/fuzzing/corpus/incorrect_escape_seq.ark +++ /dev/null @@ -1 +0,0 @@ -(print "\i bla bla bla") \ No newline at end of file diff --git a/tests/fuzzing/corpus/incorrect_import.ark b/tests/fuzzing/corpus/incorrect_import.ark deleted file mode 100644 index 4835b642d..000000000 --- a/tests/fuzzing/corpus/incorrect_import.ark +++ /dev/null @@ -1 +0,0 @@ -(import a.b :c:*) \ No newline at end of file diff --git a/tests/fuzzing/corpus/list1.ark b/tests/fuzzing/corpus/list1.ark deleted file mode 100644 index 02a0961b5..000000000 --- a/tests/fuzzing/corpus/list1.ark +++ /dev/null @@ -1,21 +0,0 @@ -(let a [1 2 3]) -(let b [4 5 6]) - -(let bar (fun (a b) ())) - -(let make (fun (a b) - (fun (&a &b) ()))) -(let foo (make "hello" 1)) - -(bar ["hello" 1] [foo.a foo.b]) -(bar 2 (len [foo.a foo.b])) -(bar ["hello"] (append [] foo.a)) - -(bar (append a 4) [1 2 3 4]) -(bar a [1 2 3]) -(bar (append a a) [1 2 3 [1 2 3]]) -(bar a [1 2 3]) - -(bar (concat a b) [1 2 3 4 5 6]) -(bar a [1 2 3]) -(bar b [4 5 6]) \ No newline at end of file diff --git a/tests/fuzzing/corpus/list2.ark b/tests/fuzzing/corpus/list2.ark deleted file mode 100644 index 9243f9ef1..000000000 --- a/tests/fuzzing/corpus/list2.ark +++ /dev/null @@ -1,17 +0,0 @@ -(let a [1 2 3]) -(let b [4 5 6]) - -(let bar (fun (a b) ())) - -(let make (fun (a b) - (fun (&a &b) ()))) -(let foo (make "hello" 1)) - -(bar (pop a 0) [2 3]) -(bar (pop a 1) [1 3]) -(bar (pop a 2) [1 2]) -(bar a [1 2 3]) - -(bar (list:reverse a) [3 2 1]) -(bar a [1 2 3]) -(bar (list:reverse []) []) \ No newline at end of file diff --git a/tests/fuzzing/corpus/list3.ark b/tests/fuzzing/corpus/list3.ark deleted file mode 100644 index cdace7205..000000000 --- a/tests/fuzzing/corpus/list3.ark +++ /dev/null @@ -1,19 +0,0 @@ -(let a [1 2 3]) -(let b [4 5 6]) - -(let bar (fun (a b) ())) - -(let make (fun (a b) - (fun (&a &b) ()))) -(let foo (make "hello" 1)) - -(bar (list:find a 0) -1) -(bar (list:find a 2) 1) - -(bar (list:slice a 0 0 1) []) -(bar a [1 2 3]) -(bar (list:slice a 0 3 2) [1 3]) -(bar a [1 2 3]) - -(bar (list:sort [3 1 2]) a) -(bar a [1 2 3]) \ No newline at end of file diff --git a/tests/fuzzing/corpus/list4.ark b/tests/fuzzing/corpus/list4.ark deleted file mode 100644 index be3d373e7..000000000 --- a/tests/fuzzing/corpus/list4.ark +++ /dev/null @@ -1,28 +0,0 @@ -(let a [1 2 3]) -(let b [4 5 6]) - -(let bar (fun (a b) ())) - -(let make (fun (a b) - (fun (&a &b) ()))) -(let foo (make "hello" 1)) - -(bar (list:fill 5 nil) [nil nil nil nil nil]) - -(let c (list:setAt a 1 "b")) -(bar c [1 "b" 3]) -(bar a [1 2 3]) - -(mut c a) -(mut d b) -(append! c 4) -(bar c [1 2 3 4]) -(concat! c d) -(bar c [1 2 3 4 4 5 6]) -(bar d [4 5 6]) -(pop! c -1) -(bar c [1 2 3 4 4 5]) -(pop! c 1) -(bar c [1 3 4 4 5]) -(bar a [1 2 3]) -(bar b [4 5 6]) \ No newline at end of file diff --git a/tests/fuzzing/corpus/macro_cond.ark b/tests/fuzzing/corpus/macro_cond.ark deleted file mode 100644 index 1fd358be4..000000000 --- a/tests/fuzzing/corpus/macro_cond.ark +++ /dev/null @@ -1,2 +0,0 @@ -($ -> (arg fn1 ...fn) { - ($if (> (len fn) 0) (-> (fn1 arg) ...fn) (fn1 arg))}) \ No newline at end of file diff --git a/tests/fuzzing/corpus/not_callable.ark b/tests/fuzzing/corpus/not_callable.ark deleted file mode 100644 index 9636f8380..000000000 --- a/tests/fuzzing/corpus/not_callable.ark +++ /dev/null @@ -1 +0,0 @@ -(()) \ No newline at end of file diff --git a/tests/fuzzing/corpus/not_enough_args_operator.ark b/tests/fuzzing/corpus/not_enough_args_operator.ark deleted file mode 100644 index 62cdd377b..000000000 --- a/tests/fuzzing/corpus/not_enough_args_operator.ark +++ /dev/null @@ -1 +0,0 @@ -(print (!= 1)) \ No newline at end of file diff --git a/tests/fuzzing/corpus/out_of_range_in_place.ark b/tests/fuzzing/corpus/out_of_range_in_place.ark deleted file mode 100644 index a48e18abc..000000000 --- a/tests/fuzzing/corpus/out_of_range_in_place.ark +++ /dev/null @@ -1,2 +0,0 @@ -(let a [1 2 3]) -(pop! a 4) diff --git a/tests/fuzzing/corpus/string.ark b/tests/fuzzing/corpus/string.ark deleted file mode 100644 index 1908280b8..000000000 --- a/tests/fuzzing/corpus/string.ark +++ /dev/null @@ -1,10 +0,0 @@ -(let foo (fun (a b) ())) - -(foo "hllo world" (str:removeAt "hello world" 1)) -(foo "ello world" (str:removeAt "hello world" 0)) -(foo "hello worl" (str:removeAt "hello world" 10)) - -(foo -1 (str:find "hello" "help")) -(foo 0 (str:find "hello" "hel")) -(foo 2 (str:find "hello" "llo")) -(foo -1 (str:find "" "1")) \ No newline at end of file diff --git a/tests/fuzzing/corpus/tests_arkscript_async-tests.ark b/tests/fuzzing/corpus/tests_arkscript_async-tests.ark new file mode 100644 index 000000000..68ae39e1d --- /dev/null +++ b/tests/fuzzing/corpus/tests_arkscript_async-tests.ark @@ -0,0 +1,41 @@ +(import std.Testing) +(import std.List) + +(let foo (fun (a b) (+ a b))) +(let async-foo (async foo 1 2)) + +(let size 1000) +(let data (list:fill size 1)) + +(let sum (fun (a b src) { + (mut acc 0) + (while (< a b) { + (set acc (+ acc (@ src a))) + (set a (+ 1 a))}) + acc })) + +(test:suite async { + (test:case "async-foo should be an awaitable function returning 3" { + (test:eq (type async-foo) "UserType") + (test:eq (await async-foo) 3)}) + + (test:case "calling await on async-foo again should not crash but return nil" { + (test:eq nil (await async-foo))}) + + (test:case "async call is faster than non-async" { + (let start-non-async (time)) + (let res-non-async (sum 0 size data)) + (let time-non-async (- (time) start-non-async)) + + (let start-async (time)) + (let workers [ + (async sum 0 (/ size 4) data) + (async sum (/ size 4) (/ size 2) data) + (async sum (/ size 2) (- size (/ size 4)) data) + (async sum (- size (/ size 4)) size data)]) + (let res-async (list:reduce (list:map workers (fun (w) (await w))) (fun (a b) (+ a b)))) + (let time-async (- (time) start-async)) + + (test:eq 1000 res-async) + (test:eq 1000 res-non-async) + (test:expect (< time-async time-non-async))})}) diff --git a/tests/fuzzing/corpus/tests_arkscript_builtins-tests.ark b/tests/fuzzing/corpus/tests_arkscript_builtins-tests.ark new file mode 100644 index 000000000..f4737e7c6 --- /dev/null +++ b/tests/fuzzing/corpus/tests_arkscript_builtins-tests.ark @@ -0,0 +1,65 @@ +(import std.Testing) + +(let base-list [1 2 3]) +(let base-list-enhanced (concat base-list [4 5])) + +(test:suite builtin { + (test:eq (append (append base-list 4) 5) base-list-enhanced) + (test:eq (concat base-list [4 5]) base-list-enhanced) + (test:eq (type []) "List") + (test:eq (list:reverse base-list) [3 2 1]) + (test:eq (list:reverse []) []) + (test:eq (list:find [] nil) -1) + (test:eq (list:find [12] 12) 0) + (test:eq (list:find [1 2 3] 2) 1) + (test:eq (list:find [12] nil) -1) + (test:eq (list:slice base-list-enhanced 0 3 1) base-list) + (test:eq (list:slice base-list-enhanced 0 1 1) [1]) + (test:eq (list:slice base-list-enhanced 0 3 2) [1 3]) + (test:eq (list:sort [5 4 3 2 1]) [1 2 3 4 5]) + (test:eq (list:sort [5]) [5]) + (test:eq (list:sort []) []) + + # fixme + #(let short_list (list:fill 12 nil)) + #(test:eq (len short_list) 12) + #(mut i 0) + #(while (< i 12) { + # (test:eq (@ short_list i) nil) + # (set i (+ 1 i))}) + #(del i) +# + #(test:eq (@ (list:setAt short_list 5 "a") 5) "a") + #(del short_list) + + (test:expect (not (io:fileExists? "test.txt"))) + (io:writeFile "test.txt" "hello, world!") + (test:expect (io:fileExists? "test.txt")) + (test:eq (io:readFile "test.txt") "hello, world!") + (test:expect (> (len (io:listFiles "./")) 0)) + (test:expect (not (io:dir? "test.txt"))) + (test:expect (not (io:fileExists? "temp"))) + (io:makeDir "temp") + (test:expect (io:fileExists? "temp")) + (test:expect (io:dir? "temp")) + (let old (time)) + (sys:sleep 1) + (test:expect (< old (time))) + + # no need to test str:format, we are already using it for the assertions, + # and it's also heavily tested in the C++ String repository in the ArkScript-lang organization (github) + + (test:eq (str:find "abc" "d") -1) + (test:eq (str:find "abc" "a") 0) + (test:eq (str:find "abc" "bc") 1) + (test:eq (str:find "abcdefghijkl" "defijkl") -1) + (test:eq (str:find "abcdefghijkl" "defghijkl") 3) + (test:eq (str:removeAt "abcdefghijkl" 3) "abcefghijkl") + (test:eq (str:removeAt "abcdefghijkl" 0) "bcdefghijkl") + (test:eq (str:removeAt "abcdefghijkl" 11) "abcdefghijk") + + # no need to test the math functions since they're 1:1 binding of C++ functions and were carefully checked + # before writing this comment, to ensure we aren't binding math:sin to the C++ tan function + + # clean up + (io:removeFiles "test.txt" "temp/") }) diff --git a/tests/fuzzing/corpus/tests_arkscript_list-tests.ark b/tests/fuzzing/corpus/tests_arkscript_list-tests.ark new file mode 100644 index 000000000..0da2ea6ff --- /dev/null +++ b/tests/fuzzing/corpus/tests_arkscript_list-tests.ark @@ -0,0 +1,72 @@ +(import std.Testing) + +(let a [1 2 3]) +(let b [4 5 6]) + +(test:suite list { + (let make (fun (a b) + (fun (&a &b) ()))) + (let foo (make "hello" 1)) + + # if this is failing, this is most likely to be a compiler problem + (test:eq ["hello" 1] [foo.a foo.b]) + (test:eq 2 (len [foo.a foo.b])) + (test:eq ["hello"] (append [] foo.a)) + + (test:case "append and return a new list" { + (test:eq (append a 4) [1 2 3 4]) + (test:eq a [1 2 3]) + (test:eq (append a a) [1 2 3 [1 2 3]]) + (test:eq a [1 2 3]) }) + + (test:case "concat and return a new list" { + (test:eq (concat a b) [1 2 3 4 5 6]) + (test:eq a [1 2 3]) + (test:eq b [4 5 6]) }) + + (test:case "pop and return a new list" { + (test:eq (pop a 0) [2 3]) + (test:eq (pop a 1) [1 3]) + (test:eq (pop a 2) [1 2]) + (test:eq a [1 2 3]) }) + + (test:case "reverse and return a new list" { + (test:eq (list:reverse a) [3 2 1]) + (test:eq a [1 2 3]) + (test:eq (list:reverse []) []) }) + + (test:case "find element in list" { + (test:eq (list:find a 0) -1) + (test:eq (list:find a 2) 1) }) + + (test:case "slice and return a new list" { + (test:eq (list:slice a 0 0 1) []) + (test:eq a [1 2 3]) + (test:eq (list:slice a 0 3 2) [1 3]) + (test:eq a [1 2 3]) }) + + (test:case "sort and return a new list" { + (test:eq (list:sort [3 1 2]) a) + (test:eq a [1 2 3]) }) + + (test:eq (list:fill 5 nil) [nil nil nil nil nil]) + + (test:case "modify list at index and return a new list" { + (let c (list:setAt a 1 "b")) + (test:eq c [1 "b" 3]) + (test:eq a [1 2 3]) }) + + (test:case "in place list mutation" { + (mut c a) + (mut d b) + (append! c 4) + (test:eq c [1 2 3 4]) + (concat! c d) + (test:eq c [1 2 3 4 4 5 6]) + (test:eq d [4 5 6]) + (pop! c -1) + (test:eq c [1 2 3 4 4 5]) + (pop! c 1) + (test:eq c [1 3 4 4 5]) + (test:eq a [1 2 3]) + (test:eq b [4 5 6]) })}) diff --git a/tests/fuzzing/corpus/tests_arkscript_macro-tests.ark b/tests/fuzzing/corpus/tests_arkscript_macro-tests.ark new file mode 100644 index 000000000..be7a0c3dd --- /dev/null +++ b/tests/fuzzing/corpus/tests_arkscript_macro-tests.ark @@ -0,0 +1,136 @@ +(import std.Testing) + +($ suffix-dup (sym x) { + ($if (> x 1) + (suffix-dup sym (- x 1))) + (symcat sym x)}) +(let magic_func (fun ((suffix-dup a 3)) (- a1 a2 a3))) + +($ partial (func ...defargs) { + ($ bloc (suffix-dup a (- (argcount func) (len defargs)))) + (fun (bloc) (func ...defargs bloc)) + ($undef bloc)}) + +(let test_func (fun (a b c) (* a b c))) +(let test_func1 (partial test_func 1)) +(let test_func1_2 (partial test_func1 2)) + +(test:suite macro { + ($ nice_value 12) + + (test:case "basic macros" { + ($ void () nil) + (test:eq (void) nil) + + ($ add_two (a b) (+ a b)) + + (test:eq (add_two 1 2) 3) + (test:eq (add_two nice_value 2) 14) }) + + (test:case "conditional macros" { + (test:expect ($if (and true true) true false)) + (test:expect ($if (= nice_value 12) true false)) + (test:expect ($if (and true (= nice_value 12)) true false)) + (test:expect ($if (and false (= nice_value 12)) false true)) + (test:expect ($if (or false (= nice_value 12)) true false)) + (test:expect ($if (or false (!= nice_value 12)) false true)) + (test:expect ($if (not (= nice_value 12)) false true)) + (test:expect ($if (< nice_value 14) true false)) + (test:expect ($if (> nice_value 14) false true)) + (test:expect ($if (<= nice_value 12) true false)) + (test:expect ($if (>= nice_value 12) true false)) + (test:expect ($if (@ [true false] 0) true false)) + (test:expect ($if (@ [true false] -2) true false)) + ($if true { + ($ in_if_1 true) + ($ in_if_2 true)}) + + (test:expect (and in_if_1 in_if_2) "a variable can be defined inside a conditional macro") + ($undef in_if_1) + ($undef in_if_2) }) + + { + ($ val (+ 1 2 3)) + (test:eq val 6 "val should be computed to 6") + + { + ($ val 0) + (test:eq val 0 "val is shadowed") + ($undef val) + (test:eq val 6 "shadowed version should be undefined") + ($undef a)} # shouldn't yield an error on unknown macros + + (test:eq val 6 "val should still resolve to 6")} + + (test:case "macro expansion" { + ($ bar (a ...args) (+ a (len args))) + (test:eq (bar 1) 1) + (test:eq (bar 2 3) 3) + (test:eq (bar 4 5 6) 6) + (test:eq (bar 7 8 9 10) 10) + + ($ egg (...args) (bar ...args)) + (test:eq (egg 1) 1) + (test:eq (egg 0 1) 1) + (test:eq (egg 0 0 0 1) 3) + + ($ h (...args) (head args)) + (test:eq (h) nil) + (test:eq (h 1) 1) + (test:eq (h 1 2) 1) + + ($ g (...args) (tail args)) + (test:eq (g) []) + (test:eq (g 1) []) + (test:eq (g 1 2) [2]) + (test:eq (g 1 2 3) [2 3]) + + ($ one (...args) (@ args 1)) + (test:eq (one 1 2) 2) + (test:eq (one 1 3 4) 3) + (test:eq (one 1 5 6 7 8) 5) + + ($ last (...args) (@ args -1)) + (test:eq (last 1 2) 2) + (test:eq (last 1 3 4) 4) + (test:eq (last 1 5 6 7 8) 8) }) + + (test:case "generate valid arkscript code with macros" { + ($ make-func (retval) (fun () retval)) + (let a-func (make-func 1)) + (test:eq (type a-func) "Function") + (test:eq (a-func) 1) + + ($ defun (name args body) (let name (fun args body))) + (defun foo (a b) (+ a b)) + (test:eq (type foo) "Function") + (test:eq (foo 2 3) 5) + + ($ get_symbol (bloc) (@ bloc 1)) + ($ define (bloc) (let (get_symbol bloc) (@ bloc 2))) + (define (let a 12)) + (test:eq a 12) }) + + (test:case "define variable with a macro adding a suffix" { + ($ nice_value 12) + ($ define (prefix suffix value) (let (symcat prefix suffix) value)) + + (define a 1 2) + (test:eq a1 2) + (define a (+ 1 1) 2) + (test:eq a2 2) + (define a (- 1 1) 2) + (test:eq a0 2) + (define a (+ nice_value 1) 2) + (test:eq a13 2) }) + + (test:case "partial functions" { + (test:eq (magic_func 1 2 3) (- 1 2 3)) + (test:eq (argcount test_func) 3) + (test:eq (argcount test_func1) 2) + (test:eq (argcount test_func1_2) 1) + (test:eq (argcount (fun () ())) 0) + (test:eq (argcount (fun (a) ())) 1) + (test:eq (argcount (fun (a b g h u t) ())) 6) + (test:eq (test_func 1 2 3) (test_func1 2 3)) + (test:eq (test_func 1 2 3) (test_func1_2 3)) })}) diff --git a/tests/fuzzing/corpus/tests_arkscript_string-tests.ark b/tests/fuzzing/corpus/tests_arkscript_string-tests.ark new file mode 100644 index 000000000..178f0f768 --- /dev/null +++ b/tests/fuzzing/corpus/tests_arkscript_string-tests.ark @@ -0,0 +1,14 @@ +(import std.Testing) +(import std.String) + +(test:suite string { + (test:case "remove char in string at index" { + (test:eq "hllo world" (str:removeAt "hello world" 1)) + (test:eq "ello world" (str:removeAt "hello world" 0)) + (test:eq "hello worl" (str:removeAt "hello world" 10)) }) + + (test:case "find substring" { + (test:eq -1 (str:find "hello" "help")) + (test:eq 0 (str:find "hello" "hel")) + (test:eq 2 (str:find "hello" "llo")) + (test:eq -1 (str:find "" "1")) })}) diff --git a/tests/fuzzing/corpus/tests_arkscript_unittests.ark b/tests/fuzzing/corpus/tests_arkscript_unittests.ark new file mode 100644 index 000000000..d8bb99d3b --- /dev/null +++ b/tests/fuzzing/corpus/tests_arkscript_unittests.ark @@ -0,0 +1,7 @@ +(import vm-tests) +(import builtins-tests) +(import utf8-tests) +(import macro-tests) +(import list-tests) +(import string-tests) +(import async-tests) diff --git a/tests/fuzzing/corpus/tests_arkscript_utf8-tests.ark b/tests/fuzzing/corpus/tests_arkscript_utf8-tests.ark new file mode 100644 index 000000000..5294d6adf --- /dev/null +++ b/tests/fuzzing/corpus/tests_arkscript_utf8-tests.ark @@ -0,0 +1,32 @@ +(import std.Testing) + +(test:suite utf8 { + (test:case "weird variable names" { + (let ---> 15) + (test:eq ---> 15) + + (let <-- 16) + (test:eq <-- 16) + (test:expect (< ---> <--)) }) + + (test:case "iterating on a list of emojis" { + (let emotes [ + "🥳" "😅" "😥" "👿" "🟢" "🙊" + "💡" "💻" "🌟" "🔹" "🌐" "🤖" + "🖐" "🤔" "🤩" "🤠" "😊"]) + (mut i 0) + (while (< i (len emotes)) { + (test:eq (len (@ emotes i)) 4) + (set i (+ 1 i)) })}) + + (test:case "testing conversion patterns \\u and \\U" { + (test:eq "\U0001f47f" "👿") + (test:eq "\U0001F47F" "👿") + (test:eq "\u1e0b" "ḋ") + (test:eq "\u1E0B" "ḋ") }) + + (test:case "testing emoji codepoints computing" { + (test:eq (str:ord "👺") 128122) + (test:eq (str:chr 128122) "👺") + (test:eq (str:ord "$") 36) + (test:eq (str:chr 36) "$") })}) diff --git a/tests/fuzzing/corpus/tests_arkscript_vm-tests.ark b/tests/fuzzing/corpus/tests_arkscript_vm-tests.ark new file mode 100644 index 000000000..6f0cdeeb7 --- /dev/null +++ b/tests/fuzzing/corpus/tests_arkscript_vm-tests.ark @@ -0,0 +1,139 @@ +(import std.Testing) + +(let tests 0) +(let closure (fun (&tests) ())) +(let make (fun (a b c) + (fun (&a &b &c) ()))) +(let make2 (fun (a b c) + (fun (&a &b &c) ()))) +(let closure_1 (make 1 2 3)) +(let closure_1_bis closure_1) +(let closure_2 (make 1 2 3)) +(let closure_3 (make 3 2 3)) +(let closure_4 (make2 1 2 3)) + +(let inner 0) +(let call (fun () { + (set val 5) + (set inner 12) })) +(let get (fun () [val inner])) +(let child (fun (&inner &call &get) ())) +(mut val 1) +(let parent (fun (&val &child) ())) + +(let create-human (fun (name age) { + (let set-age (fun (new-age) (set age new-age))) + (fun (&set-age &name &age) ()) })) +(let bob (create-human "Bob" 38)) + +(test:suite vm { + (test:case "arithmetic operations" { + (test:eq (+ 1 2) 3) + (test:eq (+ 1.5 2.5) 4.0) + (test:eq (- 1 2) -1) + (test:eq (- 1.5 2) -0.5) + (test:eq (/ 1 2) 0.5) + (test:eq (/ 10 2) 5) + (test:eq (* 1 2) 2) + (test:eq (* 0.5 2) 1) + (test:eq (mod 12 5) 2) + (test:eq (mod 12.5 5.5) 1.5) }) + + (test:case "comparisons" { + (test:expect (> 0 -4)) + (test:expect (> "hello" "a")) + (test:expect (< -4 0)) + (test:expect (< "abc" "super man")) + (test:expect (<= -4 0)) + (test:expect (<= "abc" "abc")) + (test:expect (<= "abc" "super man")) + (test:expect (>= 0 -4)) + (test:expect (>= "hello" "hello")) + (test:expect (>= "hello" "abc")) + (test:neq "hello" "abc") + (test:neq nil true) + (test:neq nil false) + (test:neq true false) + (test:neq [] "") + (test:neq "" 1) + (test:neq "" nil) + (test:neq "" true) + (test:neq "" false) }) + + (test:case "lengths and list operations" { + (test:eq (len "hello") 5) + (test:eq (len "") 0) + (test:eq (len [""]) 1) + (test:eq (len []) 0) + (test:expect (empty? "")) + (test:expect (empty? [])) + (test:eq (tail "") "") + (test:eq (tail "a") "") + (test:eq (tail "abc") "bc") + (test:eq (tail []) []) + (test:eq (tail [1]) []) + (test:eq (tail [1 2 3]) [2 3]) + (test:eq (head "") "") + (test:eq (head "a") "a") + (test:eq (head "abc") "a") + (test:eq (head []) nil) + (test:eq (head [1]) 1) + (test:eq (head [1 2 3]) 1) + (test:expect (nil? nil)) + (test:expect (not (nil? ""))) + (test:expect (not (nil? []))) }) + + (test:case "conversions" { + (test:eq (toNumber "12") 12) + (test:eq (toNumber "abc") nil) + (test:eq (toNumber "-12.5") -12.5) + (test:eq (toString 12) "12") + (test:eq (toString nil) "nil") + (test:eq (toString true) "true") + (test:eq (toString false) "false") + (test:eq (toString [1 2]) "[1 2]") + (test:eq (toString ["12"]) "[\"12\"]") }) + + (test:case "indexing" { + (test:eq (@ "hello" 1) "e") + (test:eq (@ "hello" -1) "o") + (test:eq (@ "hello" -4) "e") + (test:eq (@ ["h" "e" "l" "l" "o"] 1) "e") + (test:eq (@ ["h" "e" "l" "l" "o"] -1) "o") + (test:eq (@ ["h" "e" "l" "l" "o"] -4) "e") }) + + (test:case "De Morgan's law" { + (test:expect (and true true true)) + (test:expect (not (and true nil true))) + (test:expect (or false true nil)) + (test:expect (not (or false "" nil))) }) + + (test:case "types" { + (test:eq (type []) "List") + (test:eq (type 1) "Number") + (test:eq (type "") "String") + (test:eq (type make) "Function") + (test:eq (type print) "CProc") + (test:eq (type closure) "Closure") + (test:eq (type nil) "Nil") + (test:eq (type true) "Bool") + (test:eq (type false) "Bool") + (test:expect (hasField closure "tests")) + (test:expect (not (hasField closure "12"))) }) + + (test:case "closures" { + (test:eq (toString closure) "(.tests=0)") + (test:eq closure_1 closure_1_bis) + (test:eq closure_1 closure_2) + (test:neq closure_1 closure_4) + (test:neq closure_2 closure_3) + (test:neq closure_1 closure_3) + (test:neq closure closure_1) + + (test:eq bob.age 38) + (bob.set-age 40) + (test:eq bob.age 40) + + (test:eq (parent.child.get) [1 0]) + (parent.child.call) + (test:eq (parent.child.get) [5 12]) })}) diff --git a/tests/fuzzing/corpus/tests_benchmarks_resources_parser_big.ark b/tests/fuzzing/corpus/tests_benchmarks_resources_parser_big.ark new file mode 100644 index 000000000..2d9cee185 --- /dev/null +++ b/tests/fuzzing/corpus/tests_benchmarks_resources_parser_big.ark @@ -0,0 +1,318 @@ +# @brief Iterate over a given list and run a given function on every element. +# @param _L the list to iterate over +# @param _func the function to call on each element +# @details The original list is left unmodified. +# =begin +# (import "List.ark") +# (let collection [1 2 5 12]) +# (list:forEach collection (fun (element) { +# (print element) +# })) +# =end +# @author https://github.com/SuperFola +(let list:forEach (fun (_L _func) { + (mut _index 0) + (while (< _index (len _L)) { + (mut _element (@ _L _index)) + (_func _element) + (set _index (+ 1 _index))})})) + +# @brief Iterate over a given list and multiply all the elements with the others. +# @param _L the list to iterate over +# @details The original list is left unmodified. +# =begin +# (import "List.ark") +# (let collection [1 2 5 12]) +# (let p (list:product collection)) # => 120 +# =end +# @author https://github.com/FrenchMasterSword +(let list:product (fun (_L) { + (mut _index 0) + (mut _output 1) + (while (< _index (len _L)) { + (set _output (* _output (@ _L _index))) + (set _index (+ 1 _index))}) + _output })) + +# @brief Iterate over a given list and sum all the elements. +# @param _L the list to iterate over +# @details The original list is left unmodified. +# =begin +# (import "List.ark") +# (let collection [1 2 5 12]) +# (let p (list:sum collection)) # => 20 +# =end +# @author https://github.com/FrenchMasterSword +(let list:sum (fun (_L) { + (mut _index 0) + (mut _output 0) + (while (< _index (len _L)) { + (set _output (+ _output (@ _L _index))) + (set _index (+ 1 _index))}) + _output })) + +(import lib.math :min :max) # needed for math:min, math:max + +# @brief Drop the first n elements of a list +# @param _L the list to work on +# @param _n the number of elements to drop +# @details The original list is left unmodified. +# =begin +# (let cool-stuff [1 2 3 4 5 6 7 8 9]) +# (print (list:drop cool-stuff 4)) # [5 6 7 8 9] +# =end +# @author https://github.com/rstefanic, https://github.com/SuperFola +(let list:drop (fun (_L _n) + (if (< _n (/ (len _L) 2)) + (if (> _n 0) + (list:drop (tail _L) (- _n 1)) + _L) + { + (mut _index (max 0 _n)) + (mut _output []) + (while (< _index (len _L)) { + (set _output (append _output (@ _L _index))) + (set _index (+ 1 _index))}) + _output }))) + +# @brief Drop the first elements of a list, while they match a given predicate +# @param _L the list to work on +# @param _f the predicate +# @details The original list is left unmodified. +# =begin +# (let cool-stuff [1 2 3 4 5 6 7 8 9]) +# (print (list:dropWhile cool-stuff (fun (a) (< a 4)))) # [4 5 6 7 8 9] +# =end +# @author https://github.com/SuperFola +(let list:dropWhile (fun (_L _f) { + (mut _index 0) + (mut _output []) + (while (< _index (len _L)) + (if (_f (@ _L _index)) + (set _index (+ 1 _index)) + + (while (< _index (len _L)) { + (set _output (append _output (@ _L _index))) + (set _index (+ 1 _index))}))) + _output })) + +# @brief Keep elements in a given list if they follow a predicate +# @param _L the list to work on +# @param _f the predicate +# @details The original list is left unmodified. +# =begin +# (import "Math.ark") +# (print (list:filter [1 2 3 4 5 6 7 8 9] math:even)) # [2 4 6 8] +# =end +# @author https://github.com/rstefanic +(let list:filter (fun (_L _f) { + (mut _index 0) + (mut _output []) + (while (< _index (len _L)) { + (if (_f (@ _L _index)) + (set _output (append _output (@ _L _index)))) + (set _index (+ 1 _index))}) + _output })) + +# @brief Apply a given function to each element of a list +# @param _L the list to work on +# @param _f the function to apply to each element +# @details The original list is left unmodified. +# =begin +# (print (list:map [1 2 3 4 5 6 7 8 9] (fun (e) (* e e)))) # [1 4 9 25 36 49 64 81] +# =end +# @author https://github.com/rstefanic +(let list:map (fun (_L _f) { + (mut _index 0) + (mut _output []) + (while (< _index (len _L)) { + (set _output (append _output (_f (@ _L _index)))) + (set _index (+ 1 _index))}) + _output })) + +# @brief Apply a function to the elements of a list to reduce it +# @param _L the list to work on +# @param _f the function to apply +# @details The original list is left unmodified. +# =begin +# (let cool [1 2 3 4 5 6 7 8 9]) +# (print (list:reduce cool (fun (a b) (+ a b)))) # 45 +# =end +# @author https://github.com/FrenchMasterSword +(let list:reduce (fun (_L _f) { + (mut _index 1) + (mut _output (@ _L 0)) + (while (< _index (len _L)) { + (set _output (_f _output (@ _L _index))) + (set _index (+ 1 _index))}) + _output })) + +# @brief Flatten a list +# @param _L the list to work on +# @details The original list is left unmodified. +# =begin +# (let cool [[1 2 3] [4] 5 6 [7 8] 9]) +# (print (list:flatten cool)) # [1 2 3 4 5 6 7 8 9] +# =end +# @author https://github.com/SuperFola +(let list:flatten (fun (_L) { + (mut _index 0) + (mut _output []) + (while (< _index (len _L)) { + (mut _sub (@ _L _index)) + (set _output (if (= "List" (type _sub)) + (concat _output _sub) + (append _output _sub))) + (set _index (+ 1 _index))}) + _output })) + +# @brief Apply a given function to each element of a list and then flatten it +# @param _L the list to work on +# @param _f the function to apply to each element +# @details The original list is left unmodified. +# =begin +# (let cool [1 2 3 4]) +# (print (list:flatMap cool (fun (a) [a a]))) # [1 1 2 2 3 3 4 4] +# =end +# @author https://github.com/SuperFola +(let list:flatMap (fun (_L _f) { + (mut _index 0) + (mut _output []) + (while (< _index (len _L)) { + (mut _res (_f (@ _L _index))) + (set _output (if (= "List" (type _res)) + (concat _output _res) + (append _output _res))) + (set _index (+ 1 _index))}) + _output })) + +# @brief Take the first n elements of +# @param _L the list to work on +# @param _n the number of elements to take +# @details The original list is left unmodified. +# =begin +# (print (list:take [1 2 3 4 5 6 7 8 9] 4)) # [1 2 3 4] +# =end +# @author https://github.com/rstefanic +(let list:take (fun (_L _n) { + (mut _index 0) + (mut _output []) + (set _n (min _n (len _L))) + + (while (< _index _n) { + (set _output (append _output (@ _L _index))) + (set _index (+ 1 _index))}) + _output })) + +# @brief Take the first n elements of a list, given a predicate +# @param _L the list to work on +# @param _f the predicate +# @details The original list is left unmodified. +# =begin +# (print (takeWhile [1 2 3 4 5 6 7 8 9 10] (fun (a) (< a 4)))) # [1 2 3] +# =end +# @author https://github.com/rakista112 +(let list:takeWhile (fun (_L _f) { + (mut _index 0) + (mut _output []) + (mut continue true) + (while (and (< _index (len _L)) continue) + (if (_f (@ _L _index)) + { + (set _output (append _output (@ _L _index))) + (set _index (+ 1 _index))} + (set continue false))) + _output })) + +# @brief Unzip a list of [[a b] [c d]...] into [[a c ...] [b d ...]] +# @param _L the list to work on +# @details The original list is left unmodified. +# =begin +# (let zipped [[1 5] [2 6] [3 7] [4 8]]) +# (print (list:unzip zipped)) # [[1 2 3 4] [5 6 7 8]] +# =end +# @author https://github.com/FrenchMasterSword +(let list:unzip (fun (_L) { + (let _m (len _L)) + (mut _list1 []) + (mut _list2 []) + (mut _index 0) + (while (< _index _m) { + (mut current (@ _L _index)) + (set _list1 (append _list1 (@ current 0))) + (set _list2 (append _list2 (@ current 1))) + (set _index (+ 1 _index))}) + [_list1 _list2] })) + +# @brief Zip two lists into one: [1 2 3 4] and [5 6 7 8] will give [[1 5] [2 6] [3 7] [4 8]] +# @param _a the first list to work on +# @param _b the second list to work on +# @details The original lists are left unmodified. +# =begin +# (let a [1 2 3 4]) +# (let b [5 6 7 8]) +# (print (list:zip a b)) # [[1 5] [2 6] [3 7] [4 8]] +# =end +# @author https://github.com/FrenchMasterSword +(let list:zip (fun (_a _b) { + (let _m (min (len _a) (len _b))) + (mut _c []) + (mut _index 0) + (while (< _index _m) { + (set _c (append _c [(@ _a _index) (@ _b _index)])) + (set _index (+ 1 _index))}) + _c })) + +# @brief Fold a given list, starting from the left side +# @param _L the list to work on +# @param _init an init value +# @param _f a function to apply to the list +# @details The original list is left unmodified. +# =begin +# (let a [1 2 3 4]) +# (print (list:foldLeft a 0 (fun (a b) (+ a b)))) # 10 +# =end +# @author https://github.com/SuperFola +(let list:foldLeft (fun (_L _init _f) { + (mut _index 0) + (mut _val _init) + (while (< _index (len _L)) { + (set _val (_f _val (@ _L _index))) + (set _index (+ 1 _index))}) + _val })) + +# @brief Check if a condition is verified for all elements of a list +# @param _L the list to work on +# @param _f the conditon +# =begin +# (let a [1 2 3 4]) +# (let f (fun (e) (< e 5))) +# (print (list:forAll a f)) # true +# =end +# @author https://github.com/Gryfenfer97 +(let list:forAll (fun (_L _f) { + (mut _verified true) + (mut _index 0) + (while (and _verified (< _index (len _L))) { + (if (not (_f (@ _L _index))) + (set _verified false)) + (set _index (+ 1 _index))}) + _verified })) + +# @brief Check if a condition if verified for one or more elements of a list +# @param _L the list to work on +# @param _f the conditon +# =begin +# (let a [1 2 3 4]) +# (let f (fun (e) (< e 3))) +# (print (list:any a f)) # true +# =end +# @author https://github.com/Gryfenfer97 +(let list:any (fun (_L _f) { + (mut _verified false) + (mut _index 0) + (while (and (not _verified) (< _index (len _L))) { + (if (_f (@ _L _index)) + (set _verified true)) + (set _index (+ 1 _index))}) + _verified })) diff --git a/tests/fuzzing/corpus/tests_benchmarks_resources_parser_medium.ark b/tests/fuzzing/corpus/tests_benchmarks_resources_parser_medium.ark new file mode 100644 index 000000000..62d05c3e1 --- /dev/null +++ b/tests/fuzzing/corpus/tests_benchmarks_resources_parser_medium.ark @@ -0,0 +1,25 @@ +# a function which just prints its argument +(let egg (fun (bar) (print bar))) +# the data we're going to give to this function +(let data ["Iron Man" "is" "Tony Stark"]) +# a list of function call which should be executed later on +(mut callbacks []) + +(print "Data: " data) +(print "Generating callbacks") +(mut acc 0) +# here we are filling the list callbacks +(while (notEq acc (len data)) { + (mut d (at data acc)) + (set callbacks (append callbacks (fun (&d) (egg d)))) + (set acc (add 1 acc))}) + +# then we reset the accumulator +(set acc 0) +(while (notEq acc (len callbacks)) { + (mut var (at callback acc)) + (print "stored: " var.d) + (puts "Calling callback number " acc ": ") + (mut stored (at callbacks acc)) + (stored) + (set acc (add 1 acc))}) diff --git a/tests/fuzzing/corpus/tests_benchmarks_resources_parser_simple.ark b/tests/fuzzing/corpus/tests_benchmarks_resources_parser_simple.ark new file mode 100644 index 000000000..89acfc1a6 --- /dev/null +++ b/tests/fuzzing/corpus/tests_benchmarks_resources_parser_simple.ark @@ -0,0 +1,12 @@ +(import some.important :code :base) + +(let a (if (equal b c) 1 "4")) +(if (foo a) + (print a " is a very interesting variable")) + +(mut foo (fun (bar egg &captured) { + (let yes indeed) + (add 1 yes)})) + +(while true { + (foo true nil false)}) diff --git a/tests/fuzzing/corpus/tests_benchmarks_resources_runtime_ackermann.ark b/tests/fuzzing/corpus/tests_benchmarks_resources_runtime_ackermann.ark new file mode 100644 index 000000000..355a9969f --- /dev/null +++ b/tests/fuzzing/corpus/tests_benchmarks_resources_runtime_ackermann.ark @@ -0,0 +1,11 @@ +(let ackermann (fun (m n) { + (if (> m 0) + # then + (if (= 0 n) + # then + (ackermann (- m 1) 1) + # else + (ackermann (- m 1) (ackermann m (- n 1)))) + # else + (+ 1 n))})) +(ackermann 3 7) diff --git a/tests/fuzzing/corpus/tests_benchmarks_resources_runtime_fibonacci.ark b/tests/fuzzing/corpus/tests_benchmarks_resources_runtime_fibonacci.ark new file mode 100644 index 000000000..0e6a3b298 --- /dev/null +++ b/tests/fuzzing/corpus/tests_benchmarks_resources_runtime_fibonacci.ark @@ -0,0 +1,5 @@ +(let fibo (fun (n) + (if (< n 2) + n + (+ (fibo (- n 1)) (fibo (- n 2)))))) +(fibo 22) diff --git a/tests/fuzzing/corpus/tests_benchmarks_resources_runtime_man_or_boy_test.ark b/tests/fuzzing/corpus/tests_benchmarks_resources_runtime_man_or_boy_test.ark new file mode 100644 index 000000000..9f4aca38e --- /dev/null +++ b/tests/fuzzing/corpus/tests_benchmarks_resources_runtime_man_or_boy_test.ark @@ -0,0 +1,9 @@ +(let A (fun (k x1 x2 x3 x4 x5) { + (let B (fun () { + (set k (- k 1)) + (A k B x1 x2 x3 x4) })) + (if (<= k 0) + (+ (x4) (x5)) + (B)) })) + +(A 3 (fun () 1) (fun () -1) (fun () -1) (fun () 1) (fun () 0)) diff --git a/tests/fuzzing/corpus/tests_benchmarks_resources_runtime_quicksort.ark b/tests/fuzzing/corpus/tests_benchmarks_resources_runtime_quicksort.ark new file mode 100644 index 000000000..f8f2fbf2f --- /dev/null +++ b/tests/fuzzing/corpus/tests_benchmarks_resources_runtime_quicksort.ark @@ -0,0 +1,21 @@ +(let filter (fun (lst cond) { + (mut output []) + (mut i 0) + (while (< i (len lst)) { + (if (cond (@ lst i)) + (append! output (@ lst i))) + (set i (+ 1 i))}) + output })) + +(let quicksort (fun (array) { + (if (empty? array) + [] + { + (let pivot (head array)) + (mut less (quicksort (filter (tail array) (fun (e) (< e pivot))))) + (let more (quicksort (filter (tail array) (fun (e) (>= e pivot))))) + (concat! less [pivot] more) + less })})) + +(let a [3 6 1 5 1 65 324 765 1 6 3 0 6 9 6 5 3 2 5 6 7 64 645 7 345 432 432 4 324 23]) +(quicksort a) diff --git a/tests/fuzzing/corpus/tests_errors_callable_arity_error_async.ark b/tests/fuzzing/corpus/tests_errors_callable_arity_error_async.ark new file mode 100644 index 000000000..aab7f8c96 --- /dev/null +++ b/tests/fuzzing/corpus/tests_errors_callable_arity_error_async.ark @@ -0,0 +1,4 @@ +(let sum (fun (a b c) + (+ a b c))) + +(await (async sum 1 2 3 4)) diff --git a/tests/fuzzing/corpus/fmt_arg_not_found.ark b/tests/fuzzing/corpus/tests_errors_callable_fmt_arg_not_found.ark similarity index 100% rename from tests/fuzzing/corpus/fmt_arg_not_found.ark rename to tests/fuzzing/corpus/tests_errors_callable_fmt_arg_not_found.ark diff --git a/tests/fuzzing/corpus/tests_errors_callable_not_callable.ark b/tests/fuzzing/corpus/tests_errors_callable_not_callable.ark new file mode 100644 index 000000000..fbb2ed7bd --- /dev/null +++ b/tests/fuzzing/corpus/tests_errors_callable_not_callable.ark @@ -0,0 +1 @@ +(()) diff --git a/tests/fuzzing/corpus/not_enough_args_callable.ark b/tests/fuzzing/corpus/tests_errors_callable_not_enough_args.ark similarity index 78% rename from tests/fuzzing/corpus/not_enough_args_callable.ark rename to tests/fuzzing/corpus/tests_errors_callable_not_enough_args.ark index 805f74cc8..b481f6e4d 100644 --- a/tests/fuzzing/corpus/not_enough_args_callable.ark +++ b/tests/fuzzing/corpus/tests_errors_callable_not_enough_args.ark @@ -1,2 +1,2 @@ (let foo (fun (a b) (+ a b))) -(foo 1) \ No newline at end of file +(foo 1) diff --git a/tests/fuzzing/corpus/recursion_depth.ark b/tests/fuzzing/corpus/tests_errors_callable_recursion_depth.ark similarity index 100% rename from tests/fuzzing/corpus/recursion_depth.ark rename to tests/fuzzing/corpus/tests_errors_callable_recursion_depth.ark diff --git a/tests/fuzzing/corpus/too_many_args_callable.ark b/tests/fuzzing/corpus/tests_errors_callable_too_many_args.ark similarity index 71% rename from tests/fuzzing/corpus/too_many_args_callable.ark rename to tests/fuzzing/corpus/tests_errors_callable_too_many_args.ark index be693ae92..2642f4391 100644 --- a/tests/fuzzing/corpus/too_many_args_callable.ark +++ b/tests/fuzzing/corpus/tests_errors_callable_too_many_args.ark @@ -1,2 +1,2 @@ (let foo (fun (a b) (+ a b))) -(foo 1 2 3) \ No newline at end of file +(foo 1 2 3) diff --git a/tests/fuzzing/corpus/can_not_call.ark b/tests/fuzzing/corpus/tests_errors_capture_can_not_call.ark similarity index 100% rename from tests/fuzzing/corpus/can_not_call.ark rename to tests/fuzzing/corpus/tests_errors_capture_can_not_call.ark diff --git a/tests/fuzzing/corpus/tests_errors_capture_unbound.ark b/tests/fuzzing/corpus/tests_errors_capture_unbound.ark new file mode 100644 index 000000000..165f289b0 --- /dev/null +++ b/tests/fuzzing/corpus/tests_errors_capture_unbound.ark @@ -0,0 +1 @@ +(mut d (fun (&d) (print d))) diff --git a/tests/fuzzing/corpus/tests_errors_compiler_import_too_long.ark b/tests/fuzzing/corpus/tests_errors_compiler_import_too_long.ark new file mode 100644 index 000000000..15c181fbc --- /dev/null +++ b/tests/fuzzing/corpus/tests_errors_compiler_import_too_long.ark @@ -0,0 +1 @@ +(import 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.00000000000000000000000000000000000000000000.000.0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fun00000000000000000000000000000000000000000000000000000000000000000000.00) diff --git a/tests/fuzzing/corpus/tests_errors_compiler_invalid_codepoint.ark b/tests/fuzzing/corpus/tests_errors_compiler_invalid_codepoint.ark new file mode 100644 index 000000000..25796857e --- /dev/null +++ b/tests/fuzzing/corpus/tests_errors_compiler_invalid_codepoint.ark @@ -0,0 +1 @@ +� diff --git a/tests/fuzzing/corpus/tests_errors_compiler_invalid_escape_seq.ark b/tests/fuzzing/corpus/tests_errors_compiler_invalid_escape_seq.ark new file mode 100644 index 000000000..03e23bdc4 --- /dev/null +++ b/tests/fuzzing/corpus/tests_errors_compiler_invalid_escape_seq.ark @@ -0,0 +1 @@ +(print "\0") diff --git a/tests/fuzzing/corpus/tests_errors_compiler_invalid_func.ark b/tests/fuzzing/corpus/tests_errors_compiler_invalid_func.ark new file mode 100644 index 000000000..e2e4c0a31 --- /dev/null +++ b/tests/fuzzing/corpus/tests_errors_compiler_invalid_func.ark @@ -0,0 +1 @@ +(let foo (fun (a b) ($ a b))) diff --git a/tests/fuzzing/corpus/invalid_let.ark b/tests/fuzzing/corpus/tests_errors_compiler_invalid_let.ark similarity index 100% rename from tests/fuzzing/corpus/invalid_let.ark rename to tests/fuzzing/corpus/tests_errors_compiler_invalid_let.ark diff --git a/tests/fuzzing/corpus/tests_errors_compiler_invalid_node_in_call.ark b/tests/fuzzing/corpus/tests_errors_compiler_invalid_node_in_call.ark new file mode 100644 index 000000000..b47e26f18 --- /dev/null +++ b/tests/fuzzing/corpus/tests_errors_compiler_invalid_node_in_call.ark @@ -0,0 +1,2 @@ +(let foo (fun (a) ())) +(foo {}) diff --git a/tests/fuzzing/corpus/tests_errors_compiler_invalid_node_in_list.ark b/tests/fuzzing/corpus/tests_errors_compiler_invalid_node_in_list.ark new file mode 100644 index 000000000..4384732e5 --- /dev/null +++ b/tests/fuzzing/corpus/tests_errors_compiler_invalid_node_in_list.ark @@ -0,0 +1 @@ +[(mut c 1)] diff --git a/tests/fuzzing/corpus/tests_errors_compiler_invalid_node_in_ope.ark b/tests/fuzzing/corpus/tests_errors_compiler_invalid_node_in_ope.ark new file mode 100644 index 000000000..1d52c5b6c --- /dev/null +++ b/tests/fuzzing/corpus/tests_errors_compiler_invalid_node_in_ope.ark @@ -0,0 +1 @@ +(+ {} 1) diff --git a/tests/fuzzing/corpus/tests_errors_compiler_invalid_node_in_tail_call.ark b/tests/fuzzing/corpus/tests_errors_compiler_invalid_node_in_tail_call.ark new file mode 100644 index 000000000..d3e242491 --- /dev/null +++ b/tests/fuzzing/corpus/tests_errors_compiler_invalid_node_in_tail_call.ark @@ -0,0 +1,2 @@ +(let foo (fun (a) (foo {}))) +(foo 1) diff --git a/tests/fuzzing/corpus/tests_errors_compiler_invalid_while.ark b/tests/fuzzing/corpus/tests_errors_compiler_invalid_while.ark new file mode 100644 index 000000000..021d422aa --- /dev/null +++ b/tests/fuzzing/corpus/tests_errors_compiler_invalid_while.ark @@ -0,0 +1,3 @@ +(while ($ a b) { + (set acc (+ acc (@ src a))) + (set a (+ 1 a))}) diff --git a/tests/fuzzing/corpus/let_no_sym.ark b/tests/fuzzing/corpus/tests_errors_compiler_let_no_sym.ark similarity index 100% rename from tests/fuzzing/corpus/let_no_sym.ark rename to tests/fuzzing/corpus/tests_errors_compiler_let_no_sym.ark diff --git a/tests/fuzzing/corpus/tests_errors_compiler_sub_import_too_long.ark b/tests/fuzzing/corpus/tests_errors_compiler_sub_import_too_long.ark new file mode 100644 index 000000000..5161ce9b2 --- /dev/null +++ b/tests/fuzzing/corpus/tests_errors_compiler_sub_import_too_long.ark @@ -0,0 +1 @@ +(import a.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) diff --git a/tests/fuzzing/corpus/tests_errors_compiler_type_no_args.ark b/tests/fuzzing/corpus/tests_errors_compiler_type_no_args.ark new file mode 100644 index 000000000..5bc2db7dc --- /dev/null +++ b/tests/fuzzing/corpus/tests_errors_compiler_type_no_args.ark @@ -0,0 +1 @@ +(print (type)) diff --git a/tests/fuzzing/corpus/well_formed_args.ark b/tests/fuzzing/corpus/tests_errors_compiler_well_formed_args.ark similarity index 100% rename from tests/fuzzing/corpus/well_formed_args.ark rename to tests/fuzzing/corpus/tests_errors_compiler_well_formed_args.ark diff --git a/tests/fuzzing/corpus/at_out_of_range.ark b/tests/fuzzing/corpus/tests_errors_index_at_out_of_range.ark similarity index 100% rename from tests/fuzzing/corpus/at_out_of_range.ark rename to tests/fuzzing/corpus/tests_errors_index_at_out_of_range.ark diff --git a/tests/fuzzing/corpus/at_str_out_of_range.ark b/tests/fuzzing/corpus/tests_errors_index_at_str_out_of_range.ark similarity index 100% rename from tests/fuzzing/corpus/at_str_out_of_range.ark rename to tests/fuzzing/corpus/tests_errors_index_at_str_out_of_range.ark diff --git a/tests/fuzzing/corpus/pop_out_of_range.ark b/tests/fuzzing/corpus/tests_errors_index_pop_out_of_range.ark similarity index 100% rename from tests/fuzzing/corpus/pop_out_of_range.ark rename to tests/fuzzing/corpus/tests_errors_index_pop_out_of_range.ark diff --git a/tests/fuzzing/corpus/argcount_unknown_arg.ark b/tests/fuzzing/corpus/tests_errors_macros_argcount_unknown_arg.ark similarity index 100% rename from tests/fuzzing/corpus/argcount_unknown_arg.ark rename to tests/fuzzing/corpus/tests_errors_macros_argcount_unknown_arg.ark diff --git a/tests/fuzzing/corpus/macro_at_out_of_range.ark b/tests/fuzzing/corpus/tests_errors_macros_at_out_of_range.ark similarity index 100% rename from tests/fuzzing/corpus/macro_at_out_of_range.ark rename to tests/fuzzing/corpus/tests_errors_macros_at_out_of_range.ark diff --git a/tests/fuzzing/corpus/tests_errors_macros_duplicated_arg.ark b/tests/fuzzing/corpus/tests_errors_macros_duplicated_arg.ark new file mode 100644 index 000000000..1a98502ed --- /dev/null +++ b/tests/fuzzing/corpus/tests_errors_macros_duplicated_arg.ark @@ -0,0 +1,17 @@ +($ -> (arg fn ...fn) { + ($if (> (len fn) 0) + (-> (fn1 arg) ...fn) + (fn1 arg))}) + +(let filename "a") + +(let f1 (fun (data) { + (+ data "000")})) +(let f2 (fun (data) { + (+ data "002")})) +(let f3 (fun (data) { + (+ data "003")})) +(let f4 (fun (data) { + (+ data "004")})) + +(print (-> filename f1 f2 f3 f4)) diff --git a/tests/fuzzing/corpus/tests_errors_macros_invalid_let_in_macro.ark b/tests/fuzzing/corpus/tests_errors_macros_invalid_let_in_macro.ark new file mode 100644 index 000000000..23b7761e2 --- /dev/null +++ b/tests/fuzzing/corpus/tests_errors_macros_invalid_let_in_macro.ark @@ -0,0 +1,3 @@ +($ defun (name args body) (let 0000 (fun args body))) +(defun a_func (a b) (+ a b)) +(print (a_func 1 2)) diff --git a/tests/fuzzing/corpus/tests_errors_macros_invalid_sym_func_def.ark b/tests/fuzzing/corpus/tests_errors_macros_invalid_sym_func_def.ark new file mode 100644 index 000000000..36f8429ad --- /dev/null +++ b/tests/fuzzing/corpus/tests_errors_macros_invalid_sym_func_def.ark @@ -0,0 +1,2 @@ +($ defun (name args body) (let name (fun args body))) +(defun 0 (a b) (+ a b)) diff --git a/tests/fuzzing/corpus/tests_errors_macros_max_depth.ark b/tests/fuzzing/corpus/tests_errors_macros_max_depth.ark new file mode 100644 index 000000000..ded7da302 --- /dev/null +++ b/tests/fuzzing/corpus/tests_errors_macros_max_depth.ark @@ -0,0 +1,2 @@ +($ size (/ size 4)) +(let sum size) diff --git a/tests/fuzzing/corpus/tests_errors_macros_max_unification_depth.ark b/tests/fuzzing/corpus/tests_errors_macros_max_unification_depth.ark new file mode 100644 index 000000000..ecad62b8e --- /dev/null +++ b/tests/fuzzing/corpus/tests_errors_macros_max_unification_depth.ark @@ -0,0 +1,20 @@ +($ suffix-dup (sym x){ + ($if (+ x 1) + est_func + ($ p (a b c) (* a b c))) + (symcat sym x)}) + +($ partial (func ...defargs) { + ($ bloc (suffix-dup a (len defargs))) + (fun (bloc) (func ...defargs bloc)) + ($undef bloc)}) + +(let test + (partial + (* a b) + (let inner (partial te t_func 0)) + (let est_func + ($ partial (func ...defargs) { + ($ bloc (suffix-dup a (len defargs))) + (fun (bloc) (func ...defargs bloc)) + ($undef bloc)})))) diff --git a/tests/fuzzing/corpus/not_enough_args_macro.ark b/tests/fuzzing/corpus/tests_errors_macros_not_enough_args.ark similarity index 75% rename from tests/fuzzing/corpus/not_enough_args_macro.ark rename to tests/fuzzing/corpus/tests_errors_macros_not_enough_args.ark index ab064e540..49430d0c1 100644 --- a/tests/fuzzing/corpus/not_enough_args_macro.ark +++ b/tests/fuzzing/corpus/tests_errors_macros_not_enough_args.ark @@ -1,4 +1,4 @@ ($ foo (a b c) (+ a b c)) -(foo 1 2) \ No newline at end of file +(foo 1 2) diff --git a/tests/fuzzing/corpus/too_many_args_macro.ark b/tests/fuzzing/corpus/tests_errors_macros_too_many_args.ark similarity index 68% rename from tests/fuzzing/corpus/too_many_args_macro.ark rename to tests/fuzzing/corpus/tests_errors_macros_too_many_args.ark index 3dc047cb6..d864d5440 100644 --- a/tests/fuzzing/corpus/too_many_args_macro.ark +++ b/tests/fuzzing/corpus/tests_errors_macros_too_many_args.ark @@ -1,4 +1,4 @@ ($ foo (a b c) (+ a b c)) -(foo 1 2 3 4) \ No newline at end of file +(foo 1 2 3 4) diff --git a/tests/fuzzing/corpus/tests_errors_macros_unevaluated_spread.ark b/tests/fuzzing/corpus/tests_errors_macros_unevaluated_spread.ark new file mode 100644 index 000000000..8c24b14bc --- /dev/null +++ b/tests/fuzzing/corpus/tests_errors_macros_unevaluated_spread.ark @@ -0,0 +1,4 @@ +($ partial { + (fun (a) (func ...defargs)) }) + +(let b (partial)) diff --git a/tests/fuzzing/corpus/append_in_place.ark b/tests/fuzzing/corpus/tests_errors_mutability_append_in_place.ark similarity index 100% rename from tests/fuzzing/corpus/append_in_place.ark rename to tests/fuzzing/corpus/tests_errors_mutability_append_in_place.ark diff --git a/tests/fuzzing/corpus/concat_in_place.ark b/tests/fuzzing/corpus/tests_errors_mutability_concat_in_place.ark similarity index 100% rename from tests/fuzzing/corpus/concat_in_place.ark rename to tests/fuzzing/corpus/tests_errors_mutability_concat_in_place.ark diff --git a/tests/fuzzing/corpus/pop_in_place.ark b/tests/fuzzing/corpus/tests_errors_mutability_pop_in_place.ark similarity index 100% rename from tests/fuzzing/corpus/pop_in_place.ark rename to tests/fuzzing/corpus/tests_errors_mutability_pop_in_place.ark diff --git a/tests/fuzzing/corpus/redefine_var.ark b/tests/fuzzing/corpus/tests_errors_mutability_redefine.ark similarity index 100% rename from tests/fuzzing/corpus/redefine_var.ark rename to tests/fuzzing/corpus/tests_errors_mutability_redefine.ark diff --git a/tests/fuzzing/corpus/self_concat.ark b/tests/fuzzing/corpus/tests_errors_mutability_self_concat.ark similarity index 100% rename from tests/fuzzing/corpus/self_concat.ark rename to tests/fuzzing/corpus/tests_errors_mutability_self_concat.ark diff --git a/tests/fuzzing/corpus/set_const.ark b/tests/fuzzing/corpus/tests_errors_mutability_set_const.ark similarity index 100% rename from tests/fuzzing/corpus/set_const.ark rename to tests/fuzzing/corpus/tests_errors_mutability_set_const.ark diff --git a/tests/fuzzing/corpus/db0.ark b/tests/fuzzing/corpus/tests_errors_operators_db0.ark similarity index 100% rename from tests/fuzzing/corpus/db0.ark rename to tests/fuzzing/corpus/tests_errors_operators_db0.ark diff --git a/tests/fuzzing/corpus/ope_freestanding.ark b/tests/fuzzing/corpus/tests_errors_operators_freestanding.ark similarity index 100% rename from tests/fuzzing/corpus/ope_freestanding.ark rename to tests/fuzzing/corpus/tests_errors_operators_freestanding.ark diff --git a/tests/fuzzing/corpus/ope_no_args.ark b/tests/fuzzing/corpus/tests_errors_operators_no_args.ark similarity index 100% rename from tests/fuzzing/corpus/ope_no_args.ark rename to tests/fuzzing/corpus/tests_errors_operators_no_args.ark diff --git a/tests/fuzzing/corpus/tests_errors_operators_not_enough_args.ark b/tests/fuzzing/corpus/tests_errors_operators_not_enough_args.ark new file mode 100644 index 000000000..26e342e2d --- /dev/null +++ b/tests/fuzzing/corpus/tests_errors_operators_not_enough_args.ark @@ -0,0 +1 @@ +(print (!= 1)) diff --git a/tests/fuzzing/corpus/del_unbound.ark b/tests/fuzzing/corpus/tests_errors_scope_del_unbound.ark similarity index 100% rename from tests/fuzzing/corpus/del_unbound.ark rename to tests/fuzzing/corpus/tests_errors_scope_del_unbound.ark diff --git a/tests/fuzzing/corpus/set_unbound.ark b/tests/fuzzing/corpus/tests_errors_scope_set_unbound.ark similarity index 100% rename from tests/fuzzing/corpus/set_unbound.ark rename to tests/fuzzing/corpus/tests_errors_scope_set_unbound.ark diff --git a/tests/fuzzing/corpus/unbound.ark b/tests/fuzzing/corpus/tests_errors_scope_unbound.ark similarity index 100% rename from tests/fuzzing/corpus/unbound.ark rename to tests/fuzzing/corpus/tests_errors_scope_unbound.ark diff --git a/tests/fuzzing/corpus/nil_not_a_function.ark b/tests/fuzzing/corpus/tests_errors_type_nil_not_a_function.ark similarity index 100% rename from tests/fuzzing/corpus/nil_not_a_function.ark rename to tests/fuzzing/corpus/tests_errors_type_nil_not_a_function.ark diff --git a/tests/fuzzing/corpus/not_a_closure.ark b/tests/fuzzing/corpus/tests_errors_type_not_a_closure.ark similarity index 100% rename from tests/fuzzing/corpus/not_a_closure.ark rename to tests/fuzzing/corpus/tests_errors_type_not_a_closure.ark diff --git a/tests/fuzzing/corpus/unknown_field.ark b/tests/fuzzing/corpus/tests_errors_type_unknown_field.ark similarity index 100% rename from tests/fuzzing/corpus/unknown_field.ark rename to tests/fuzzing/corpus/tests_errors_type_unknown_field.ark diff --git a/tests/fuzzing/corpus/tests_unittests_resources_astsuite_99bottles.ark b/tests/fuzzing/corpus/tests_unittests_resources_astsuite_99bottles.ark new file mode 100644 index 000000000..d96a216af --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_astsuite_99bottles.ark @@ -0,0 +1,21 @@ +# Lyrics from the song: +# +# 99 bottles of beer on the wall +# 99 bottles of beer +# Take one down, pass it around +# 98 bottles of beer on the wall +# +# 98 bottles of beer on the wall +# 98 bottles of beer +# Take one down, pass it around +# 97 bottles of beer on the wall + + +(let arg (if (>= (len sys:args) 1) (toNumber (@ sys:args 0)) nil)) +(let i (if (nil? arg) 100 arg)) + +(mut n i) +(while (> n 1) { + (print (str:format "{} Bottles of beer on the wall\n{} bottles of beer\nTake one down, pass it around" n n)) + (set n (- n 1)) + (print (str:format "{} Bottles of beer on the wall." n))}) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_astsuite_ackermann.ark b/tests/fuzzing/corpus/tests_unittests_resources_astsuite_ackermann.ark new file mode 100644 index 000000000..879145214 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_astsuite_ackermann.ark @@ -0,0 +1,21 @@ +# the Ackermann Peter function (see https://en.wikipedia.org/wiki/Ackermann_function) +# One of the simplest and earliest-discovered examples of a total computable function, +# that is not primitive. All primitive recursive functions are total and computable, +# but the Ackermann function illustrates that not all total computable functions +# are primitive recursive. +# Due to its definitions in terms of extremely deep recursion, it can be used as a +# benchmark of a compiler's ability to optimize recursion, which is the reason why +# we are using this function to benchmark the language. + +(let ackermann (fun (m n) { + (if (> m 0) + # then + (if (= 0 n) + # then + (ackermann (- m 1) 1) + # else + (ackermann (- m 1) (ackermann m (- n 1)))) + # else + (+ 1 n))})) + +(print "Ackermann-Péter function, m=3, n=6: " (ackermann 3 6)) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_astsuite_closures.ark b/tests/fuzzing/corpus/tests_unittests_resources_astsuite_closures.ark new file mode 100644 index 000000000..f818e5632 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_astsuite_closures.ark @@ -0,0 +1,46 @@ +# Inspired by +# Closures and object are equivalent: http://wiki.c2.com/?ClosuresAndObjectsAreEquivalent + +# this will construct a closure capturing the 3 arguments, plus a function to set the age +(let create-human (fun (name age weight) { + # functions can be invoked in the closure scope + (let set-age (fun (new-age) (set age new-age))) + + # the return value, our closure + # the &name notation is used in the argument list to explicitly capture + # a variable (using deep copy) + (fun (&set-age &name &age &weight) ())})) + +# we create 2 humans using such construction, just a nice function call +(let bob (create-human "Bob" 0 144)) +(let john (create-human "John" 12 15)) + +# using the dot notation on a closure object, we can have a **read only** access to its fields +(print "Bob's age: " bob.age) +# and even call the captured functions, which will enter the closure, and be given a **read write** access +# meaning that, even if the fields are read only (eg, we can not do (set bob.age 14)), the "object" can be modified +(print "Setting Bob's age to 10") +(bob.set-age 10) +# the age changed +(print "New age: " bob.age) + +# but john age didn't change, because we created 2 separated closures +(print "John's age, didn't change: " john.age) + + + +# Another example to simulate a python range(x, y) + +# this function will return a closure capturing the number given +# and modifying its value each time we'll call the closure, returning +# the new number +(let countdown-from (fun (number) + (fun (&number) { + (set number (- number 1)) + number }))) + +(let countdown-from-3 (countdown-from 3)) + +(print "Countdown " (countdown-from-3)) # 2 +(print "Countdown " (countdown-from-3)) # 1 +(print "Countdown " (countdown-from-3)) # 0 diff --git a/tests/fuzzing/corpus/tests_unittests_resources_astsuite_empty_begin.ark b/tests/fuzzing/corpus/tests_unittests_resources_astsuite_empty_begin.ark new file mode 100644 index 000000000..be1c1738b --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_astsuite_empty_begin.ark @@ -0,0 +1 @@ +{{}} diff --git a/tests/fuzzing/corpus/tests_unittests_resources_astsuite_error.ark b/tests/fuzzing/corpus/tests_unittests_resources_astsuite_error.ark new file mode 100644 index 000000000..9d3c6c96d --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_astsuite_error.ark @@ -0,0 +1,22 @@ +# this is how we can import files in ArkScript +# very often, and this is a convention, +# if an imported file starts with a capital letter, +# it shall be a file in the standard library. +(import std.Exceptions) + +# the function which should do a "safe number invertion" +(let invert (fun (x) { + (if (= x 0) + # then + (throw "cannot divide by zero") # the value we should return in case of an error + # else + (return (/ 1 x)))})) # the value returned if everything is ok (if (!= x 0)) + +# this function (try) is implemented in Exceptions.ark (in lib/std/) +# and will check the return value of (invert 0) +# if it's an error (seen by the use of throw), it will call the second function, +# if it's a result, it will call the first +# it works the same way as a try: { function then } catch { do_something } +(try (invert 0) + (fun (inverted) (print inverted)) + (fun (err) (print err))) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_astsuite_factorial.ark b/tests/fuzzing/corpus/tests_unittests_resources_astsuite_factorial.ark new file mode 100644 index 000000000..160e2b808 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_astsuite_factorial.ark @@ -0,0 +1,16 @@ +# demonstration of the creation of a function +# we create a constant named fact, and put a function in it +# taking a single argument, n +(let fact (fun (n) { + (mut a 1) + (mut acc 2) + # then we use a loop (for loops doesn't exist in ArkScript) + (while (<= acc n) { + (set a (* a acc)) + # thus we need to increment the accumulator ourselves + (set acc (+ 1 acc))}) + # the return value + a })) + +# then we call the function we just created +(print "Factorial 6 (with loop and acc): " (fact 6)) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_astsuite_macros.ark b/tests/fuzzing/corpus/tests_unittests_resources_astsuite_macros.ark new file mode 100644 index 000000000..25e9cb3d4 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_astsuite_macros.ark @@ -0,0 +1,93 @@ +($ suffix-dup (sym x) { + ($if (> x 1) + (suffix-dup sym (- x 1))) + (symcat sym x)}) + +($ partial (func ...defargs) { + ($ bloc (suffix-dup a (- (argcount func) (len defargs)))) + (fun (bloc) (func ...defargs bloc)) + ($undef bloc)}) + +(let test_func (fun (a b c) (* a b c))) +(let test_func1 (partial test_func 1)) + +(print "Generated partial functions for test_func (a b c) => (* a b c)") +(print "Expected arguments for test_func: " (argcount test_func) ", expected " 3) +(print "Expected arguments for test_func1: " (argcount test_func1) ", expected " 2) +(print "Calling them: " (test_func 1 2 3) " " (test_func1 2 3)) + +($ foo (a b) (+ a b)) +(print "Using macro foo (a b) => (+ a b): " (foo 1 2)) + +($ var 12) +(print "Using macro constant var=12: " var) + +($if (= var 12) + (print "This was executed in a if macro, testing var == 12") + (print "You shouldn't see this")) + +($if (and true true) + (print "This was executed in a if macro, testing (and true true)") + (print "You shouldn't see this (bis)")) + +($ defun (name args body) (let name (fun args body))) +(defun a_func (a b) (+ a b)) +(print "Generated a function with a macro, a_func (a b) => (+ a b)") +(print "Calling (a_func 1 2): " (a_func 1 2)) + +($ one (...args) (print "Macro 'one', returns the 2nd argument given in " args " => " (@ args 1))) +(one 1 2) +(one 1 3 4) +(one 1 5 6 7 8) + +($ last (...args) (print "Macro 'last', returns the last argument given in " args " => " (@ args -1))) +(last 1 2) +(last 1 3 4) +(last 1 5 6 7 8) + +{ + (print "Testing macros in scopes and macro shadowing") + + ($ test (+ 1 2 3)) + (print "(global) Reading macro 'test', expected 6, " test) + + ((fun () { + ($ test (- 1 2 3)) + (print "(sub scope) Reading macro 'test', expected -4, " test)})) + + (print "(global) Reading macro 'test', expected 6, " test) + + { + ($ test 555) + (print "(subscope) Reading macro 'test', expected 555, " test) + ($ undef test) + (print "(subscope, undef test) Reading macro 'test', expected 6, " test) + ($ undef a)}} + +(print "Demonstrating a threading macro") + +($ -> (arg fn1 ...fn) { + ($if (> (len fn) 0) + (-> (fn1 arg) ...fn) + (fn1 arg))}) + +(let filename "hello.json") + +(let f1 (fun (data) { + (print ">>f1 " data) + (+ data "-f1")})) + +(let f2 (fun (data) { + (print ">>f2 " data) + (+ data "-f2")})) + +(let f3 (fun (data) { + (print ">>f3 " data) + (+ data "-f3")})) + +(let f4 (fun (data) { + (print ">>f4 " data) + (+ data "-f4")})) + +(print "We expected calls to go like this: f1, f2, f3, f4") +(print (-> filename f1 f2 f3 f4)) # (f4 (f3 (f2 (f1 filename)))) diff --git a/tests/fuzzing/corpus-cmin/calls.ark b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_calls.ark similarity index 87% rename from tests/fuzzing/corpus-cmin/calls.ark rename to tests/fuzzing/corpus/tests_unittests_resources_formattersuite_calls.ark index 83269517b..ad1bb90e3 100644 --- a/tests/fuzzing/corpus-cmin/calls.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_calls.ark @@ -7,4 +7,4 @@ (list:forEach _listeners (fun (element) (if (= typ (@ element 0)) { ((@ element 1) val) - (set found true)}))) \ No newline at end of file + (set found true)}))) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comment_after_macro_arg.ark b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comment_after_macro_arg.ark new file mode 100644 index 000000000..4af692a60 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comment_after_macro_arg.ark @@ -0,0 +1,5 @@ +($ -> ()#comment +{ + ($if (> (len fn) 0) + (-> (fn1 arg) ...fn) + (fn1 arg))}) diff --git a/tests/fuzzing/corpus/comment_after_macro_cond.ark b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comment_after_macro_cond.ark similarity index 100% rename from tests/fuzzing/corpus/comment_after_macro_cond.ark rename to tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comment_after_macro_cond.ark diff --git a/tests/fuzzing/corpus/comments_after_call.ark b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comments_after_call.ark similarity index 96% rename from tests/fuzzing/corpus/comments_after_call.ark rename to tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comments_after_call.ark index 900ffb282..aaf982c3a 100644 --- a/tests/fuzzing/corpus/comments_after_call.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comments_after_call.ark @@ -7,4 +7,4 @@ (foo # func bar # arg egg # arg bis - ) \ No newline at end of file + ) diff --git a/tests/fuzzing/corpus-cmin/comments_after_cond.ark b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comments_after_cond.ark similarity index 98% rename from tests/fuzzing/corpus-cmin/comments_after_cond.ark rename to tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comments_after_cond.ark index 354d8b907..eafcc3c27 100644 --- a/tests/fuzzing/corpus-cmin/comments_after_cond.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comments_after_cond.ark @@ -7,4 +7,4 @@ (if true ok no # dont go -) \ No newline at end of file +) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comments_after_import.ark b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comments_after_import.ark new file mode 100644 index 000000000..014e22008 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comments_after_import.ark @@ -0,0 +1 @@ +(import test) # test diff --git a/tests/fuzzing/corpus/comments_after_variable.ark b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comments_after_variable.ark similarity index 88% rename from tests/fuzzing/corpus/comments_after_variable.ark rename to tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comments_after_variable.ark index 635b2074f..24a025e3f 100644 --- a/tests/fuzzing/corpus/comments_after_variable.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comments_after_variable.ark @@ -2,4 +2,4 @@ ) (mut b 2) # test (set c 3 # value -) # node \ No newline at end of file +) # node diff --git a/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comments_after_while.ark b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comments_after_while.ark new file mode 100644 index 000000000..fd8647abe --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comments_after_while.ark @@ -0,0 +1,7 @@ +(while true # cond + 1 # body + ) + + +(while true {} # no body +) # infinite loop diff --git a/tests/fuzzing/corpus/conditions.ark b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_conditions.ark similarity index 85% rename from tests/fuzzing/corpus/conditions.ark rename to tests/fuzzing/corpus/tests_unittests_resources_formattersuite_conditions.ark index d9a58408b..f4095d20e 100644 --- a/tests/fuzzing/corpus/conditions.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_conditions.ark @@ -7,4 +7,4 @@ (fun () (if true 0 1)) (if # true true true false) -(if (= 1 2) { (foo) (bar) }) \ No newline at end of file +(if (= 1 2) { (foo) (bar) }) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_del.ark b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_del.ark new file mode 100644 index 000000000..ed7fda742 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_del.ark @@ -0,0 +1,3 @@ +(del a) +(del # comment +b) diff --git a/tests/fuzzing/corpus/field.ark b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_field.ark similarity index 72% rename from tests/fuzzing/corpus/field.ark rename to tests/fuzzing/corpus/tests_unittests_resources_formattersuite_field.ark index 12033069b..45e837457 100644 --- a/tests/fuzzing/corpus/field.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_field.ark @@ -2,4 +2,4 @@ (foo.closure.name # test this.bar.egg.qux) (foo.closure.name this.bar.egg.qux) -(foo.closure.name this.bar.egg.qux 1 2) \ No newline at end of file +(foo.closure.name this.bar.egg.qux 1 2) diff --git a/tests/fuzzing/corpus-cmin/functions.ark b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_functions.ark similarity index 96% rename from tests/fuzzing/corpus-cmin/functions.ark rename to tests/fuzzing/corpus/tests_unittests_resources_formattersuite_functions.ark index 884dd5d96..5ee5366c0 100644 --- a/tests/fuzzing/corpus-cmin/functions.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_functions.ark @@ -16,4 +16,4 @@ a b # capture &c) # body - {}) \ No newline at end of file + {}) diff --git a/tests/fuzzing/corpus/imports.ark b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_imports.ark similarity index 97% rename from tests/fuzzing/corpus/imports.ark rename to tests/fuzzing/corpus/tests_unittests_resources_formattersuite_imports.ark index a7df9339a..882a321ef 100644 --- a/tests/fuzzing/corpus/imports.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_imports.ark @@ -10,4 +10,4 @@ foo) (import std.foo # item :a # item -:b) \ No newline at end of file +:b) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_loop.ark b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_loop.ark new file mode 100644 index 000000000..c250f99c4 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_loop.ark @@ -0,0 +1,6 @@ +(while # true + (= 1 1) + # body + (print 1)) +(while (= 1 2) (print 3)) +(while true { 1 2 3 }) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_macro_cond.ark b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_macro_cond.ark new file mode 100644 index 000000000..1b0770052 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_macro_cond.ark @@ -0,0 +1,2 @@ +($ -> (arg fn1 ...fn) { + ($if (> (len fn) 0) (-> (fn1 arg) ...fn) (fn1 arg))}) diff --git a/tests/fuzzing/corpus/macros2.ark b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_macros.ark similarity index 95% rename from tests/fuzzing/corpus/macros2.ark rename to tests/fuzzing/corpus/tests_unittests_resources_formattersuite_macros.ark index e156af823..70bb67bcd 100644 --- a/tests/fuzzing/corpus/macros2.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_macros.ark @@ -3,4 +3,4 @@ ($ defun (name args body) (let name (fun args body))) ($ one (...args) (print "Macro 'one', returns the 2nd argument given in " args " => " (@ args 1))) ($undef a) -($repr a) \ No newline at end of file +($repr a) diff --git a/tests/fuzzing/corpus/vars.ark b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_vars.ark similarity index 71% rename from tests/fuzzing/corpus/vars.ark rename to tests/fuzzing/corpus/tests_unittests_resources_formattersuite_vars.ark index 9c0963687..666d3ab5b 100644 --- a/tests/fuzzing/corpus/vars.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_vars.ark @@ -5,4 +5,4 @@ (let d 5) (+ 5 d) }) -(let e (fun (f g) (+ f g))) \ No newline at end of file +(let e (fun (f g) (+ f g))) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_huge_number.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_huge_number.ark new file mode 100644 index 000000000..fb45eb3d7 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_huge_number.ark @@ -0,0 +1 @@ +(let a 1e+4932) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_arguments.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_arguments.ark new file mode 100644 index 000000000..3cf56caa1 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_arguments.ark @@ -0,0 +1 @@ +(fun (a diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_begin.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_begin.ark new file mode 100644 index 000000000..4ea298eb6 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_begin.ark @@ -0,0 +1 @@ +{ a b (let c d) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_call.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_call.ark new file mode 100644 index 000000000..da0f7aa55 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_call.ark @@ -0,0 +1 @@ +(a b c (if (ok true) 1 2) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_del.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_del.ark new file mode 100644 index 000000000..7124b08df --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_del.ark @@ -0,0 +1 @@ +(del) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_fun.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_fun.ark new file mode 100644 index 000000000..f45c56655 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_fun.ark @@ -0,0 +1 @@ +(fun (a b &c)) diff --git a/tests/fuzzing/corpus/incomplete_if.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_if.ark similarity index 100% rename from tests/fuzzing/corpus/incomplete_if.ark rename to tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_if.ark diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_import_1.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_import_1.ark new file mode 100644 index 000000000..477eec265 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_import_1.ark @@ -0,0 +1 @@ +(import) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_import_2.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_import_2.ark new file mode 100644 index 000000000..42e8c20f6 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_import_2.ark @@ -0,0 +1 @@ +(import a. ) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_let.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_let.ark new file mode 100644 index 000000000..13359f5b5 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_let.ark @@ -0,0 +1,2 @@ +( +let diff --git a/tests/fuzzing/corpus/incomplete_list.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_list.ark similarity index 50% rename from tests/fuzzing/corpus/incomplete_list.ark rename to tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_list.ark index a67d2c30e..ddd4ceb69 100644 --- a/tests/fuzzing/corpus/incomplete_list.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_list.ark @@ -1,3 +1,3 @@ [ 1 - 2 3 \ No newline at end of file + 2 3 diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_macro.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_macro.ark new file mode 100644 index 000000000..46261cd9f --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_macro.ark @@ -0,0 +1 @@ +($ (a) a) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_macro_arguments.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_macro_arguments.ark new file mode 100644 index 000000000..88c585efa --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_macro_arguments.ark @@ -0,0 +1 @@ +($ foo (a diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_macro_spread.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_macro_spread.ark new file mode 100644 index 000000000..93f9f2946 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_macro_spread.ark @@ -0,0 +1 @@ +($ foo (bar ...) (bar)) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_package_name.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_package_name.ark new file mode 100644 index 000000000..717a03299 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_package_name.ark @@ -0,0 +1 @@ +(import a.b. diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_string.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_string.ark new file mode 100644 index 000000000..60c5aa2e5 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_string.ark @@ -0,0 +1 @@ +(let a "1 2 3) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incorrect_arg_capture.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incorrect_arg_capture.ark new file mode 100644 index 000000000..32694139f --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incorrect_arg_capture.ark @@ -0,0 +1 @@ +(fun (a &b c) 1) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incorrect_escape_seq.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incorrect_escape_seq.ark new file mode 100644 index 000000000..049a83de4 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incorrect_escape_seq.ark @@ -0,0 +1 @@ +(print "\i bla bla bla") diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incorrect_import.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incorrect_import.ark new file mode 100644 index 000000000..3e8333238 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incorrect_import.ark @@ -0,0 +1 @@ +(import a.b :c:*) diff --git a/tests/fuzzing/corpus/invalid.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_invalid.ark similarity index 100% rename from tests/fuzzing/corpus/invalid.ark rename to tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_invalid.ark diff --git a/tests/fuzzing/corpus/begin.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_begin.ark similarity index 100% rename from tests/fuzzing/corpus/begin.ark rename to tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_begin.ark diff --git a/tests/fuzzing/corpus-cmin/call.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_call.ark similarity index 98% rename from tests/fuzzing/corpus-cmin/call.ark rename to tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_call.ark index d904227a2..9d1b8692e 100644 --- a/tests/fuzzing/corpus-cmin/call.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_call.ark @@ -12,4 +12,4 @@ func# A foo ) ) -) \ No newline at end of file +) diff --git a/tests/fuzzing/corpus/closure.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_closure.ark similarity index 70% rename from tests/fuzzing/corpus/closure.ark rename to tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_closure.ark index ff7c4c693..59a65426f 100644 --- a/tests/fuzzing/corpus/closure.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_closure.ark @@ -2,4 +2,4 @@ (fun (&a #jk &b) 2) (fun (a &b) 3) -(fun (a b &c &d) 4) \ No newline at end of file +(fun (a b &c &d) 4) diff --git a/tests/fuzzing/corpus-cmin/comments.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_comments.ark similarity index 79% rename from tests/fuzzing/corpus-cmin/comments.ark rename to tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_comments.ark index e1bcc8c3a..decf89476 100644 --- a/tests/fuzzing/corpus-cmin/comments.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_comments.ark @@ -4,4 +4,4 @@ ##) -#))(()) \ No newline at end of file +#))(()) diff --git a/tests/fuzzing/corpus/del.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_del.ark similarity index 96% rename from tests/fuzzing/corpus/del.ark rename to tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_del.ark index d636c7d06..f16879b4c 100644 --- a/tests/fuzzing/corpus/del.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_del.ark @@ -12,4 +12,4 @@ (#r del d #"" -) \ No newline at end of file +) diff --git a/tests/fuzzing/corpus/fields.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_fields.ark similarity index 86% rename from tests/fuzzing/corpus/fields.ark rename to tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_fields.ark index 4cfe33f5f..f6980d23b 100644 --- a/tests/fuzzing/corpus/fields.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_fields.ark @@ -4,4 +4,4 @@ hi.jk) l.m n.o.p) (while q.r s.t) (fun () u.v) -(begin x.y.z) \ No newline at end of file +(begin x.y.z) diff --git a/tests/fuzzing/corpus-cmin/fun.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_fun.ark similarity index 98% rename from tests/fuzzing/corpus-cmin/fun.ark rename to tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_fun.ark index b60906ca7..b387679b7 100644 --- a/tests/fuzzing/corpus-cmin/fun.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_fun.ark @@ -24,4 +24,4 @@ dddd (fun () ()) (fun (a) ( # test -)) \ No newline at end of file +)) diff --git a/tests/fuzzing/corpus/if.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_if.ark similarity index 84% rename from tests/fuzzing/corpus/if.ark rename to tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_if.ark index 69ef18122..ec05a11ab 100644 --- a/tests/fuzzing/corpus/if.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_if.ark @@ -15,4 +15,4 @@ (if 3 ()) (if (func a b) a b) -(if (a b c) (d e) (f)) \ No newline at end of file +(if (a b c) (d e) (f)) diff --git a/tests/fuzzing/corpus-cmin/import.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_import.ark similarity index 99% rename from tests/fuzzing/corpus-cmin/import.ark rename to tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_import.ark index 113e011d1..e7578bd1c 100644 --- a/tests/fuzzing/corpus-cmin/import.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_import.ark @@ -13,4 +13,4 @@ foo.bar.egg # end of line (import foo.bar # cool package :a # a nice symbol :b# another symbol we need -) \ No newline at end of file +) diff --git a/tests/fuzzing/corpus/let_atom.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_let_atom.ark similarity index 100% rename from tests/fuzzing/corpus/let_atom.ark rename to tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_let_atom.ark diff --git a/tests/fuzzing/corpus-cmin/list.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_list.ark similarity index 89% rename from tests/fuzzing/corpus-cmin/list.ark rename to tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_list.ark index 33931ac01..f10f020e2 100644 --- a/tests/fuzzing/corpus-cmin/list.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_list.ark @@ -6,4 +6,4 @@ 1 #end ] -[[1 a]] \ No newline at end of file +[[1 a]] diff --git a/tests/fuzzing/corpus-cmin/loop.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_loop.ark similarity index 64% rename from tests/fuzzing/corpus-cmin/loop.ark rename to tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_loop.ark index 168c292b3..10f3a0d71 100644 --- a/tests/fuzzing/corpus-cmin/loop.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_loop.ark @@ -11,4 +11,4 @@ while ( # 123 # 456 while 3 3 ) -(while (isGood 1) (doStuff a (if b c d))) \ No newline at end of file +(while (isGood 1) (doStuff a (if b c d))) diff --git a/tests/fuzzing/corpus-cmin/macro.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_macro.ark similarity index 93% rename from tests/fuzzing/corpus-cmin/macro.ark rename to tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_macro.ark index 180ab33a2..1e224b4a6 100644 --- a/tests/fuzzing/corpus-cmin/macro.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_macro.ark @@ -15,4 +15,4 @@ e ($ k (l ...m) (print l m)) ($ n ( ...p -) (print p)) \ No newline at end of file +) (print p)) diff --git a/tests/fuzzing/corpus/numbers.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_numbers.ark similarity index 81% rename from tests/fuzzing/corpus/numbers.ark rename to tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_numbers.ark index 8475fd064..470eef9b8 100644 --- a/tests/fuzzing/corpus/numbers.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_numbers.ark @@ -4,4 +4,4 @@ (let d 1e4) (let e 2e+8) (let f 4e-16) -(let g 8.91e-31) \ No newline at end of file +(let g 8.91e-31) diff --git a/tests/fuzzing/corpus/strings.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_strings.ark similarity index 53% rename from tests/fuzzing/corpus/strings.ark rename to tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_strings.ark index 0a83b60e0..b5f461c0a 100644 --- a/tests/fuzzing/corpus/strings.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_success_strings.ark @@ -1,2 +1,2 @@ (print "abc" "123\"test") -(print "\\ 123aéoÒ") \ No newline at end of file +(print "\\ 123aéoÒ") diff --git a/tests/fuzzing/corpus/unbound_capture.ark b/tests/fuzzing/corpus/unbound_capture.ark deleted file mode 100644 index 71de9f029..000000000 --- a/tests/fuzzing/corpus/unbound_capture.ark +++ /dev/null @@ -1 +0,0 @@ -(mut d (fun (&d) (print d))) \ No newline at end of file diff --git a/tests/fuzzing/corpus/utf8.ark b/tests/fuzzing/corpus/utf8.ark deleted file mode 100644 index 7f5a1fcc9..000000000 --- a/tests/fuzzing/corpus/utf8.ark +++ /dev/null @@ -1,28 +0,0 @@ -(let foo (fun (a b) ())) -(let bar (fun (a) ())) - -(let ---> 15) -(foo ---> 15) - -(let <-- 16) -(foo <-- 16) -(bar (< ---> <--)) - -(let emotes [ - "🥳" "😅" "😥" "👿" "🟢" "🙊" - "💡" "💻" "🌟" "🔹" "🌐" "🤖" - "🖐" "🤔" "🤩" "🤠" "😊"]) -(mut i 0) -(while (< i (len emotes)) { - (foo (len (@ emotes i)) 4) - (set i (+ 1 i)) }) - -(foo "\U0001f47f" "👿") -(foo "\U0001F47F" "👿") -(foo "\u1e0b" "ḋ") -(foo "\u1E0B" "ḋ") - -(foo (str:ord "👺") 128122) -(foo (str:chr 128122) "👺") -(foo (str:ord "$") 36) -(foo (str:chr 36) "$")