From a1de134440d25bf936538d6410150e6317247bd1 Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Sun, 7 Sep 2025 18:23:53 +0200 Subject: [PATCH 01/13] chore: update fuzzing corpus --- lib/std | 2 +- .../corpus-cmin-tmin/examples_99bottles.ark | 6 +- .../corpus-cmin-tmin/examples_blockchain.ark | 6 +- .../corpus-cmin-tmin/examples_callbacks.ark | 34 -- .../corpus-cmin-tmin/examples_collatz.ark | 38 +- .../corpus-cmin-tmin/examples_counter.ark | 4 +- .../corpus-cmin-tmin/examples_error.ark | 16 +- .../corpus-cmin-tmin/examples_factorial.ark | 4 +- .../corpus-cmin-tmin/examples_fizz_buzz.ark | 24 +- .../examples_games_game_of_life.ark | 106 ++--- .../examples_games_snake_snake.ark | 67 +-- .../corpus-cmin-tmin/examples_http.ark | 59 --- .../corpus-cmin-tmin/examples_macros.ark | 16 +- .../corpus-cmin-tmin/examples_quicksort.ark | 58 +-- .../examples_show_ascii_table.ark | 26 +- .../corpus-cmin-tmin/examples_sum_digits.ark | 42 +- .../tests_benchmarks_resources_parser_big.ark | 336 +++++++-------- ...sts_benchmarks_resources_parser_bigger.ark | 184 ++++---- ...sts_benchmarks_resources_parser_medium.ark | 2 +- ..._benchmarks_resources_runtime_builtins.ark | 4 +- ...marks_resources_runtime_create_closure.ark | 12 +- ...arks_resources_runtime_man_or_boy_test.ark | 6 +- ..._benchmarks_resources_runtime_n_queens.ark | 32 ++ ...benchmarks_resources_runtime_quicksort.ark | 8 +- ...sts_unittests_resources_astsuite_conds.ark | 2 + ...tests_unittests_resources_astsuite_del.ark | 2 +- ...ittests_resources_astsuite_empty_begin.ark | 2 +- ...sts_unittests_resources_astsuite_error.ark | 10 +- ...s_unittests_resources_astsuite_imports.ark | 3 + ...ts_resources_compilersuite_ir_closures.ark | 18 +- ...ests_resources_compilersuite_ir_plugin.ark | 4 +- ...urces_compilersuite_ir_renamed_capture.ark | 3 + ...ces_compilersuite_ir_renamed_capture_b.ark | 2 + ...s_compilersuite_optimized_ir_99bottles.ark | 14 +- ...s_compilersuite_optimized_ir_ackermann.ark | 2 +- ...es_compilersuite_optimized_ir_closures.ark | 20 +- ..._compilersuite_optimized_ir_increments.ark | 2 +- ...urces_compilersuite_optimized_ir_jumps.ark | 2 +- ...urces_compilersuite_optimized_ir_lists.ark | 10 +- ...ources_compilersuite_optimized_ir_type.ark | 2 +- ...suite_compiletime_assert_too_many_args.ark | 2 +- ...sticssuite_compiletime_at_out_of_range.ark | 2 +- ...cssuite_compiletime_bad_macro_arg_list.ark | 2 +- ...ompiletime_builtin_conflict_resolution.ark | 3 + ...osticssuite_compiletime_duplicated_arg.ark | 6 +- ...nosticssuite_compiletime_empty_capture.ark | 1 + ...icssuite_compiletime_eq_chain_too_long.ark | 2 +- ...ite_compiletime_hasfield_too_many_args.ark | 2 +- ...agnosticssuite_compiletime_invalid_let.ark | 4 +- ...suite_compiletime_invalid_node_in_list.ark | 2 +- ...nosticssuite_compiletime_invalid_while.ark | 2 +- ...iagnosticssuite_compiletime_let_no_sym.ark | 2 - ..._compiletime_macro_argcount_type_error.ark | 1 + ...te_compiletime_macro_empty_arity_error.ark | 2 +- ...e_compiletime_macro_eq_not_enough_args.ark | 1 + ...ite_compiletime_macro_head_arity_error.ark | 2 +- ...uite_compiletime_macro_len_arity_error.ark | 2 +- ...te_compiletime_macro_paste_arity_error.ark | 2 +- ...compiletime_macro_plus_not_enough_args.ark | 1 + ...mpiletime_macro_spread_not_enough_args.ark | 2 +- ...te_compiletime_macro_symcat_type_error.ark | 2 +- ...ite_compiletime_macro_tail_arity_error.ark | 2 +- ...e_compiletime_macro_type_too_many_args.ark | 1 + ...te_compiletime_macro_undef_arity_error.ark | 1 + ...diagnosticssuite_compiletime_max_depth.ark | 2 +- ...osticssuite_compiletime_max_depth_eval.ark | 2 +- ...uite_compiletime_max_unification_depth.ark | 2 +- ...diagnosticssuite_compiletime_package_b.ark | 1 - ...gnosticssuite_compiletime_pop_in_place.ark | 2 +- ...ticssuite_compiletime_reused_macro_arg.ark | 2 +- ...cssuite_compiletime_spread_use_no_name.ark | 3 + ...nosticssuite_compiletime_too_many_args.ark | 2 +- ...agnosticssuite_compiletime_unbound_var.ark | 1 - ...ite_compiletime_unbound_var_suggestion.ark | 4 +- ...cssuite_compiletime_undef_macro_number.ark | 2 +- ...cssuite_compiletime_unevaluated_spread.ark | 4 +- ...nosticssuite_runtime_arity_error_async.ark | 2 +- ...ources_diagnosticssuite_runtime_assert.ark | 1 + ..._diagnosticssuite_runtime_async_number.ark | 1 + ...ssuite_runtime_at_at_eq_out_of_range_y.ark | 2 +- ...runtime_at_at_ok_negative_outside_list.ark | 4 +- ...osticssuite_runtime_at_eq_out_of_range.ark | 4 +- ...nosticssuite_runtime_backtrace_builtin.ark | 3 + ..._runtime_builtin_proxy_not_enough_args.ark | 2 +- ...ticssuite_runtime_list_slice_end_start.ark | 2 +- ...sticssuite_runtime_list_slice_past_end.ark | 2 +- ...ticssuite_runtime_list_slice_step_null.ark | 2 +- ...osticssuite_runtime_nil_not_a_function.ark | 2 - ...diagnosticssuite_runtime_not_a_closure.ark | 4 +- ...cssuite_runtime_not_callable_with_args.ark | 3 + ...uite_runtime_pop_negative_outside_list.ark | 2 +- ...gnosticssuite_runtime_pop_out_of_range.ark | 2 +- ...agnosticssuite_runtime_recursion_depth.ark | 2 +- ...gnosticssuite_typechecking_add_num_str.ark | 2 +- ...sticssuite_typechecking_append_num_num.ark | 2 +- ..._typechecking_at_at_eq_num_num_num_num.ark | 2 +- ...cssuite_typechecking_at_eq_num_num_num.ark | 2 +- ...gnosticssuite_typechecking_at_list_str.ark | 2 +- ...agnosticssuite_typechecking_at_num_num.ark | 2 +- ...e_typechecking_decrement_index_str_num.ark | 2 + ...e_typechecking_decrement_store_str_num.ark | 2 + ...nosticssuite_typechecking_dict_add_num.ark | 1 + ...cssuite_typechecking_dict_contains_num.ark | 1 + ...nosticssuite_typechecking_dict_get_num.ark | 1 + ...osticssuite_typechecking_dict_keys_num.ark | 1 + ...osticssuite_typechecking_dict_odd_args.ark | 1 + ...ticssuite_typechecking_dict_remove_num.ark | 1 + ...osticssuite_typechecking_dict_size_num.ark | 1 + ...e_typechecking_increment_index_str_num.ark | 2 + ...e_typechecking_increment_store_str_num.ark | 2 + ...icssuite_typechecking_iofileexists_num.ark | 2 +- ...ticssuite_typechecking_iolistfiles_num.ark | 2 +- ...osticssuite_typechecking_iomakedir_num.ark | 2 +- ...ite_typechecking_ioreadfile_inexistent.ark | 2 +- ...sticssuite_typechecking_ioreadfile_num.ark | 2 +- ...icssuite_typechecking_ioremovefile_num.ark | 2 +- ...cssuite_typechecking_ioremovefiles_num.ark | 2 +- ...suite_typechecking_iowritefile_num_num.ark | 2 +- ..._diagnosticssuite_typechecking_len_num.ark | 2 +- ...ticssuite_typechecking_listreverse_str.ark | 2 +- ...nosticssuite_typechecking_listsort_str.ark | 1 - ...echecking_lt_len_sym_jump_if_false_num.ark | 5 + ...sticssuite_typechecking_matharccos_str.ark | 2 +- ...sticssuite_typechecking_matharctan_str.ark | 2 +- ...nosticssuite_typechecking_mathceil_str.ark | 2 +- ...gnosticssuite_typechecking_mathcos_str.ark | 2 +- ...nosticssuite_typechecking_mathcosh_str.ark | 2 +- ...agnosticssuite_typechecking_mathln_str.ark | 2 +- ...gnosticssuite_typechecking_mathsin_str.ark | 2 +- ...gnosticssuite_typechecking_mathtan_str.ark | 2 +- ...nosticssuite_typechecking_mathtanh_str.ark | 2 +- ...gnosticssuite_typechecking_mod_str_str.ark | 1 - ...uite_typechecking_pop_in_place_num_num.ark | 2 +- ...gnosticssuite_typechecking_pop_num_num.ark | 2 +- ...osticssuite_typechecking_stringchr_str.ark | 2 +- ...osticssuite_typechecking_stringord_num.ark | 2 +- ...nosticssuite_typechecking_syssleep_str.ark | 2 +- ...nosticssuite_typechecking_tonumber_num.ark | 2 +- ...formattersuite_comment_after_macro_arg.ark | 5 - ...ormattersuite_comment_after_macro_args.ark | 5 + ...ormattersuite_comment_after_macro_cond.ark | 4 +- ...attersuite_comment_after_node_in_begin.ark | 3 + ...ces_formattersuite_comments_after_cond.ark | 10 +- ...s_formattersuite_comments_after_import.ark | 1 - ...formattersuite_comments_after_variable.ark | 4 +- ...tersuite_complex_comments_in_condition.ark | 8 + ...ts_resources_formattersuite_conditions.ark | 2 +- ...unittests_resources_formattersuite_del.ark | 2 +- ...ts_resources_formattersuite_escape_seq.ark | 4 +- ...ittests_resources_formattersuite_field.ark | 10 +- ...tests_resources_formattersuite_imports.ark | 2 +- ...resources_formattersuite_long_arg_list.ark | 1 + ...ttests_resources_formattersuite_macros.ark | 6 +- ...nittests_resources_formattersuite_vars.ark | 2 +- ...ttests_resources_langsuite_async-tests.ark | 97 +++-- ...sts_resources_langsuite_builtins-tests.ark | 65 +-- ...ittests_resources_langsuite_list-tests.ark | 256 +++++------ ...ttests_resources_langsuite_macro-tests.ark | 312 +++++++------- ...tests_resources_langsuite_module-tests.ark | 12 + ...tests_resources_langsuite_string-tests.ark | 122 +++--- ...nittests_resources_langsuite_unittests.ark | 10 +- ...ittests_resources_langsuite_utf8-tests.ark | 52 +-- ...unittests_resources_langsuite_vm-tests.ark | 396 ++++++++++-------- ..._resources_nameresolutionsuite_basic_a.ark | 14 - ..._resources_nameresolutionsuite_basic_b.ark | 4 +- ..._resources_nameresolutionsuite_basic_d.ark | 2 + ...eresolutionsuite_deep_import_symbols_a.ark | 5 + ...e_resolve_prefixed_in_correct_import_a.ark | 4 + ...ources_nameresolutionsuite_shadowing_a.ark | 5 - ...ources_nameresolutionsuite_shadowing_c.ark | 8 +- ...e_shadowing_symbol_swap_import_order_a.ark | 5 + ...e_shadowing_symbol_swap_import_order_b.ark | 4 +- ...lutionsuite_symbol_imports_same_name_b.ark | 1 + ...lutionsuite_symbol_imports_same_name_c.ark | 4 + ...s_optimizersuite_dead_code_elimination.ark | 8 +- ...ources_parsersuite_failure_huge_number.ark | 2 +- ...rsersuite_failure_incomplete_arguments.ark | 2 +- ...s_parsersuite_failure_incomplete_begin.ark | 2 +- ...es_parsersuite_failure_incomplete_call.ark | 1 - ..._parsersuite_failure_incomplete_call_2.ark | 2 +- ...ces_parsersuite_failure_incomplete_del.ark | 2 +- ...s_parsersuite_failure_incomplete_field.ark | 1 + ...rsuite_failure_incomplete_fun_in_macro.ark | 2 + ...arsersuite_failure_incomplete_import_1.ark | 2 +- ...ces_parsersuite_failure_incomplete_let.ark | 2 +- ...es_parsersuite_failure_incomplete_list.ark | 2 +- ...rsuite_failure_incomplete_macro_spread.ark | 1 - ...rsuite_failure_incomplete_package_name.ark | 2 +- ..._parsersuite_failure_incomplete_spread.ark | 1 + ..._parsersuite_failure_incomplete_string.ark | 2 +- ...sersuite_failure_incorrect_arg_capture.ark | 2 +- ...rsuite_failure_incorrect_function_call.ark | 1 + ...s_parsersuite_failure_incorrect_import.ark | 2 +- ...rsersuite_failure_invalid_escape_seq_4.ark | 1 + ...rsersuite_failure_invalid_escape_seq_8.ark | 1 + ...rsuite_failure_invalid_hex8_escape_seq.ark | 1 + ...ts_resources_parsersuite_success_begin.ark | 16 +- ...sts_resources_parsersuite_success_call.ark | 8 +- ..._resources_parsersuite_success_closure.ark | 2 +- ...resources_parsersuite_success_comments.ark | 2 +- ...ests_resources_parsersuite_success_del.ark | 4 +- ...s_resources_parsersuite_success_fields.ark | 2 +- ...ests_resources_parsersuite_success_fun.ark | 14 +- ...tests_resources_parsersuite_success_if.ark | 18 - ...s_resources_parsersuite_success_import.ark | 2 +- ...resources_parsersuite_success_let_atom.ark | 4 +- ...ts_resources_parsersuite_success_macro.ark | 8 +- ..._resources_parsersuite_success_numbers.ark | 6 +- ..._resources_parsersuite_success_strings.ark | 4 +- ...tests_resources_rosettasuite_100_doors.ark | 28 +- ...ttests_resources_rosettasuite_a_plus_b.ark | 16 +- ...ources_rosettasuite_abbreviations_easy.ark | 106 ++--- ...resources_rosettasuite_abc_correlation.ark | 36 ++ ...tests_resources_rosettasuite_ackermann.ark | 8 + ...ettasuite_apply_a_callback_to_an_array.ark | 12 +- ...ources_rosettasuite_arithmetic_complex.ark | 40 +- ...ources_rosettasuite_arithmetic_integer.ark | 4 +- ...resources_rosettasuite_ascending_prime.ark | 34 +- ...resources_rosettasuite_ascii_lowercase.ark | 9 + ...sources_rosettasuite_balanced_brackets.ark | 44 +- ...es_rosettasuite_calculating_value_of_e.ark | 28 +- ...ts_resources_rosettasuite_catamorphism.ark | 10 +- ...es_rosettasuite_closures_value_capture.ark | 8 +- ...ources_rosettasuite_compound_data_type.ark | 2 +- ...tasuite_count_occurrences_of_substring.ark | 12 + ...urces_rosettasuite_fibonacci_iterative.ark | 2 +- ..._resources_rosettasuite_flatten_a_list.ark | 22 +- ...ttests_resources_rosettasuite_infinity.ark | 8 +- ...urces_rosettasuite_middle_three_digits.ark | 23 + ...ests_resources_rosettasuite_munchausen.ark | 40 +- ...ttests_resources_rosettasuite_n_queens.ark | 32 ++ ...esources_rosettasuite_nested_functions.ark | 9 + ...ittests_resources_rosettasuite_pangram.ark | 16 + ...tests_resources_rosettasuite_quicksort.ark | 24 +- ...resources_rosettasuite_riordan_numbers.ark | 14 + ...unittests_resources_rosettasuite_stack.ark | 26 ++ ...s_resources_rosettasuite_string_append.ark | 2 - ...resources_rosettasuite_string_matching.ark | 14 +- ...settasuite_sum_and_product_of_an_array.ark | 12 +- ..._rosettasuite_sum_digits_of_an_integer.ark | 40 +- ..._resources_rosettasuite_sum_of_a_serie.ark | 12 +- ..._resources_rosettasuite_sum_of_squares.ark | 18 +- ...ittests_resources_typecheckersuite_num.ark | 6 +- .../corpus-cmin/examples_callbacks.ark | 34 -- .../examples_games_snake_snake.ark | 15 +- tests/fuzzing/corpus-cmin/examples_http.ark | 59 --- ...sts_benchmarks_resources_parser_bigger.ark | 30 +- ...s_benchmarks_resources_runtime_for_sum.ark | 11 + ..._benchmarks_resources_runtime_n_queens.ark | 32 ++ ...sts_unittests_resources_astsuite_conds.ark | 2 + ...ittests_resources_astsuite_empty_begin.ark | 2 +- ...s_unittests_resources_astsuite_imports.ark | 3 + ...urces_compilersuite_ir_renamed_capture.ark | 3 + ...ces_compilersuite_ir_renamed_capture_b.ark | 2 + ...urces_compilersuite_optimized_ir_lists.ark | 6 + ...ompiletime_builtin_conflict_resolution.ark | 3 + ...nosticssuite_compiletime_empty_capture.ark | 1 + ...iagnosticssuite_compiletime_let_no_sym.ark | 2 - ..._compiletime_macro_argcount_type_error.ark | 1 + ...e_compiletime_macro_eq_not_enough_args.ark | 1 + ...compiletime_macro_plus_not_enough_args.ark | 1 + ...e_compiletime_macro_type_too_many_args.ark | 1 + ...te_compiletime_macro_undef_arity_error.ark | 1 + ...diagnosticssuite_compiletime_package_b.ark | 1 - ...cssuite_compiletime_spread_use_no_name.ark | 3 + ...agnosticssuite_compiletime_unbound_var.ark | 1 - ...ources_diagnosticssuite_runtime_assert.ark | 1 + ..._diagnosticssuite_runtime_async_number.ark | 1 + ...nosticssuite_runtime_backtrace_builtin.ark | 3 + ...osticssuite_runtime_nil_not_a_function.ark | 2 - ...cssuite_runtime_not_callable_with_args.ark | 3 + ...e_typechecking_decrement_index_str_num.ark | 2 + ...e_typechecking_decrement_store_str_num.ark | 2 + ...nosticssuite_typechecking_dict_add_num.ark | 1 + ...cssuite_typechecking_dict_contains_num.ark | 1 + ...nosticssuite_typechecking_dict_get_num.ark | 1 + ...osticssuite_typechecking_dict_keys_num.ark | 1 + ...osticssuite_typechecking_dict_odd_args.ark | 1 + ...ticssuite_typechecking_dict_remove_num.ark | 1 + ...osticssuite_typechecking_dict_size_num.ark | 1 + ...e_typechecking_increment_index_str_num.ark | 2 + ...e_typechecking_increment_store_str_num.ark | 2 + ...nosticssuite_typechecking_listsort_str.ark | 1 - ...echecking_lt_len_sym_jump_if_false_num.ark | 5 + ...gnosticssuite_typechecking_mod_str_str.ark | 1 - ...formattersuite_comment_after_macro_arg.ark | 5 - ...ormattersuite_comment_after_macro_args.ark | 5 + ...attersuite_comment_after_node_in_begin.ark | 3 + ...ces_formattersuite_comments_after_cond.ark | 2 +- ...s_formattersuite_comments_after_import.ark | 1 - ...formattersuite_comments_after_variable.ark | 2 +- ...tersuite_complex_comments_in_condition.ark | 8 + ...ts_resources_formattersuite_conditions.ark | 2 +- ...unittests_resources_formattersuite_del.ark | 2 +- ...ittests_resources_formattersuite_field.ark | 2 +- ...tests_resources_formattersuite_imports.ark | 2 +- ...resources_formattersuite_long_arg_list.ark | 1 + ...nittests_resources_formattersuite_vars.ark | 2 +- ...ttests_resources_langsuite_async-tests.ark | 27 +- ...sts_resources_langsuite_builtins-tests.ark | 51 +-- ...ttests_resources_langsuite_macro-tests.ark | 6 + ...tests_resources_langsuite_module-tests.ark | 12 + ...nittests_resources_langsuite_unittests.ark | 2 + ...unittests_resources_langsuite_vm-tests.ark | 82 +++- ..._resources_nameresolutionsuite_basic_a.ark | 14 - ..._resources_nameresolutionsuite_basic_d.ark | 2 + ...eresolutionsuite_deep_import_symbols_a.ark | 5 + ...e_resolve_prefixed_in_correct_import_a.ark | 4 + ...ources_nameresolutionsuite_shadowing_a.ark | 5 - ...e_shadowing_symbol_swap_import_order_a.ark | 5 + ...lutionsuite_symbol_imports_same_name_b.ark | 1 + ...utionsuite_symbol_imports_same_name_c.ark} | 0 ...ources_parsersuite_failure_huge_number.ark | 2 +- ...rsersuite_failure_incomplete_arguments.ark | 2 +- ...s_parsersuite_failure_incomplete_begin.ark | 2 +- ...es_parsersuite_failure_incomplete_call.ark | 1 - ...ces_parsersuite_failure_incomplete_del.ark | 2 +- ...s_parsersuite_failure_incomplete_field.ark | 1 + ...rsuite_failure_incomplete_fun_in_macro.ark | 2 + ...arsersuite_failure_incomplete_import_1.ark | 2 +- ...ces_parsersuite_failure_incomplete_let.ark | 2 +- ...es_parsersuite_failure_incomplete_list.ark | 2 +- ...rsuite_failure_incomplete_macro_spread.ark | 1 - ...rsuite_failure_incomplete_package_name.ark | 2 +- ..._parsersuite_failure_incomplete_spread.ark | 1 + ..._parsersuite_failure_incomplete_string.ark | 2 +- ...sersuite_failure_incorrect_arg_capture.ark | 2 +- ...rsuite_failure_incorrect_function_call.ark | 1 + ...s_parsersuite_failure_incorrect_import.ark | 2 +- ...rsersuite_failure_invalid_escape_seq_4.ark | 1 + ...rsersuite_failure_invalid_escape_seq_8.ark | 1 + ...rsuite_failure_invalid_hex8_escape_seq.ark | 1 + ...sts_resources_parsersuite_success_call.ark | 2 +- ..._resources_parsersuite_success_closure.ark | 2 +- ...resources_parsersuite_success_comments.ark | 2 +- ...ests_resources_parsersuite_success_del.ark | 2 +- ...s_resources_parsersuite_success_fields.ark | 2 +- ...ests_resources_parsersuite_success_fun.ark | 2 +- ...tests_resources_parsersuite_success_if.ark | 18 - ...s_resources_parsersuite_success_import.ark | 2 +- ..._resources_parsersuite_success_numbers.ark | 2 +- ..._resources_parsersuite_success_strings.ark | 2 +- ...tests_resources_rosettasuite_ackermann.ark | 8 + ...resources_rosettasuite_ascii_lowercase.ark | 9 + ...tasuite_count_occurrences_of_substring.ark | 12 + ...urces_rosettasuite_middle_three_digits.ark | 23 + ...ttests_resources_rosettasuite_n_queens.ark | 32 ++ ...esources_rosettasuite_nested_functions.ark | 9 + ...ittests_resources_rosettasuite_pangram.ark | 16 + ...resources_rosettasuite_riordan_numbers.ark | 14 + ...unittests_resources_rosettasuite_stack.ark | 26 ++ ...s_resources_rosettasuite_string_append.ark | 2 - ...ittests_resources_typecheckersuite_num.ark | 2 +- tests/fuzzing/corpus/examples_closures.ark | 5 +- .../corpus/examples_games_snake_snake.ark | 15 +- ...sts_benchmarks_resources_parser_bigger.ark | 30 +- ..._benchmarks_resources_runtime_n_queens.ark | 32 ++ ...sts_unittests_resources_astsuite_conds.ark | 2 + ...urces_compilersuite_ir_renamed_capture.ark | 3 + ...ces_compilersuite_ir_renamed_capture_b.ark | 2 + ...urces_compilersuite_optimized_ir_lists.ark | 6 + ...ompiletime_builtin_conflict_resolution.ark | 3 + ...nosticssuite_compiletime_empty_capture.ark | 1 + ..._compiletime_macro_argcount_type_error.ark | 1 + ...e_compiletime_macro_eq_not_enough_args.ark | 1 + ...compiletime_macro_plus_not_enough_args.ark | 1 + ...e_compiletime_macro_type_too_many_args.ark | 1 + ...te_compiletime_macro_undef_arity_error.ark | 1 + ...uite_compiletime_package_builtin__list.ark | 1 + ...cssuite_compiletime_spread_use_no_name.ark | 3 + ...ources_diagnosticssuite_runtime_assert.ark | 1 + ..._diagnosticssuite_runtime_async_number.ark | 1 + ...nosticssuite_runtime_backtrace_builtin.ark | 3 + ...e_typechecking_decrement_index_str_num.ark | 2 + ...e_typechecking_decrement_store_str_num.ark | 2 + ...nosticssuite_typechecking_dict_add_num.ark | 1 + ...cssuite_typechecking_dict_contains_num.ark | 1 + ...nosticssuite_typechecking_dict_get_num.ark | 1 + ...osticssuite_typechecking_dict_keys_num.ark | 1 + ...osticssuite_typechecking_dict_odd_args.ark | 1 + ...ticssuite_typechecking_dict_remove_num.ark | 1 + ...osticssuite_typechecking_dict_size_num.ark | 1 + ...e_typechecking_increment_index_str_num.ark | 2 + ...e_typechecking_increment_store_str_num.ark | 2 + ...echecking_lt_len_sym_jump_if_false_num.ark | 5 + ...osticssuite_typechecking_store_len_num.ark | 2 + ...ittests_resources_formattersuite_block.ark | 5 + ...ormattersuite_comment_after_macro_args.ark | 5 + ...resources_formattersuite_long_arg_list.ark | 1 + ...ttests_resources_langsuite_async-tests.ark | 27 +- ...sts_resources_langsuite_builtins-tests.ark | 51 +-- ...ttests_resources_langsuite_macro-tests.ark | 6 + ...tests_resources_langsuite_module-tests.ark | 12 + ...nittests_resources_langsuite_unittests.ark | 2 + ...unittests_resources_langsuite_vm-tests.ark | 82 +++- ...e_resolve_prefixed_in_correct_import_a.ark | 4 + ...e_resolve_prefixed_in_correct_import_b.ark | 1 + ...e_resolve_prefixed_in_correct_import_c.ark | 1 + ...lutionsuite_symbol_imports_same_name_a.ark | 4 + ...lutionsuite_symbol_imports_same_name_b.ark | 1 + ...utionsuite_symbol_imports_same_name_c.ark} | 0 ...s_parsersuite_failure_incomplete_field.ark | 1 + ...rsuite_failure_incomplete_fun_in_macro.ark | 2 + ..._parsersuite_failure_incomplete_spread.ark | 1 + ...rsuite_failure_incorrect_function_call.ark | 1 + ...rsersuite_failure_invalid_escape_seq_4.ark | 1 + ...rsersuite_failure_invalid_escape_seq_8.ark | 1 + ...rsuite_failure_invalid_hex8_escape_seq.ark | 1 + ...resources_rosettasuite_ascii_lowercase.ark | 9 + ...tasuite_count_occurrences_of_substring.ark | 12 + ...urces_rosettasuite_middle_three_digits.ark | 23 + ...ttests_resources_rosettasuite_n_queens.ark | 32 ++ ...esources_rosettasuite_nested_functions.ark | 9 + ...ittests_resources_rosettasuite_pangram.ark | 16 + ...resources_rosettasuite_riordan_numbers.ark | 14 + ...unittests_resources_rosettasuite_stack.ark | 26 ++ 416 files changed, 2875 insertions(+), 2018 deletions(-) delete mode 100644 tests/fuzzing/corpus-cmin-tmin/examples_callbacks.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/examples_http.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_n_queens.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_conds.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_imports.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_ir_renamed_capture.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_ir_renamed_capture_b.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_builtin_conflict_resolution.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_empty_capture.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_let_no_sym.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_argcount_type_error.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_eq_not_enough_args.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_plus_not_enough_args.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_type_too_many_args.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_undef_arity_error.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_package_b.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_spread_use_no_name.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_unbound_var.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_assert.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_async_number.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_backtrace_builtin.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_nil_not_a_function.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_not_callable_with_args.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_decrement_index_str_num.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_decrement_store_str_num.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_add_num.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_contains_num.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_get_num.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_keys_num.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_odd_args.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_remove_num.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_size_num.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_increment_index_str_num.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_increment_store_str_num.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_listsort_str.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_lt_len_sym_jump_if_false_num.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mod_str_str.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comment_after_macro_arg.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comment_after_macro_args.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comment_after_node_in_begin.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comments_after_import.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_complex_comments_in_condition.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_long_arg_list.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_module-tests.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_basic_a.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_basic_d.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_deep_import_symbols_a.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_resolve_prefixed_in_correct_import_a.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_shadowing_a.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_shadowing_symbol_swap_import_order_a.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_b.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_c.ark delete 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_field.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_fun_in_macro.ark delete 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_spread.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incorrect_function_call.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_4.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_8.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_invalid_hex8_escape_seq.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_if.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_abc_correlation.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_ackermann.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_ascii_lowercase.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_count_occurrences_of_substring.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_middle_three_digits.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_n_queens.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_nested_functions.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_pangram.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_riordan_numbers.ark create mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_stack.ark delete mode 100644 tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_string_append.ark delete mode 100644 tests/fuzzing/corpus-cmin/examples_callbacks.ark delete mode 100644 tests/fuzzing/corpus-cmin/examples_http.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_for_sum.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_n_queens.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_conds.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_imports.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_compilersuite_ir_renamed_capture.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_compilersuite_ir_renamed_capture_b.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_builtin_conflict_resolution.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_empty_capture.ark delete mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_let_no_sym.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_argcount_type_error.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_eq_not_enough_args.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_plus_not_enough_args.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_type_too_many_args.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_undef_arity_error.ark delete mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_package_b.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_spread_use_no_name.ark delete mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_unbound_var.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_runtime_assert.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_runtime_async_number.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_runtime_backtrace_builtin.ark delete mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_runtime_nil_not_a_function.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_runtime_not_callable_with_args.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_decrement_index_str_num.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_decrement_store_str_num.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_add_num.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_contains_num.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_get_num.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_keys_num.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_odd_args.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_remove_num.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_size_num.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_increment_index_str_num.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_increment_store_str_num.ark delete mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_listsort_str.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_lt_len_sym_jump_if_false_num.ark delete mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_mod_str_str.ark delete mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comment_after_macro_arg.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comment_after_macro_args.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comment_after_node_in_begin.ark delete mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comments_after_import.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_complex_comments_in_condition.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_long_arg_list.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_module-tests.ark delete mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_basic_a.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_basic_d.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_deep_import_symbols_a.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_resolve_prefixed_in_correct_import_a.ark delete mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_shadowing_a.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_shadowing_symbol_swap_import_order_a.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_b.ark rename tests/fuzzing/{corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_hidden_shadowing_c.ark => corpus-cmin/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_c.ark} (100%) delete 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_field.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_fun_in_macro.ark delete 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_spread.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incorrect_function_call.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_4.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_8.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_invalid_hex8_escape_seq.ark delete mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_if.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_ackermann.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_ascii_lowercase.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_count_occurrences_of_substring.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_middle_three_digits.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_n_queens.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_nested_functions.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_pangram.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_riordan_numbers.ark create mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_stack.ark delete mode 100644 tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_string_append.ark create mode 100644 tests/fuzzing/corpus/tests_benchmarks_resources_runtime_n_queens.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_astsuite_conds.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_compilersuite_ir_renamed_capture.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_compilersuite_ir_renamed_capture_b.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_builtin_conflict_resolution.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_empty_capture.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_macro_argcount_type_error.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_macro_eq_not_enough_args.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_macro_plus_not_enough_args.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_macro_type_too_many_args.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_macro_undef_arity_error.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_package_builtin__list.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_spread_use_no_name.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_runtime_assert.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_runtime_async_number.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_runtime_backtrace_builtin.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_decrement_index_str_num.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_decrement_store_str_num.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_add_num.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_contains_num.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_get_num.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_keys_num.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_odd_args.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_remove_num.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_size_num.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_increment_index_str_num.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_increment_store_str_num.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_lt_len_sym_jump_if_false_num.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_store_len_num.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_formattersuite_block.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comment_after_macro_args.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_formattersuite_long_arg_list.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_langsuite_module-tests.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_resolve_prefixed_in_correct_import_a.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_resolve_prefixed_in_correct_import_b.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_resolve_prefixed_in_correct_import_c.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_a.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_b.ark rename tests/fuzzing/{corpus-cmin/tests_unittests_resources_nameresolutionsuite_hidden_shadowing_c.ark => corpus/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_c.ark} (100%) create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_field.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_fun_in_macro.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_spread.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incorrect_function_call.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_4.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_8.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_invalid_hex8_escape_seq.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_ascii_lowercase.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_count_occurrences_of_substring.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_middle_three_digits.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_n_queens.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_nested_functions.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_pangram.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_riordan_numbers.ark create mode 100644 tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_stack.ark diff --git a/lib/std b/lib/std index eb24e389c..15ea72460 160000 --- a/lib/std +++ b/lib/std @@ -1 +1 @@ -Subproject commit eb24e389c00426ef6c598273905606887ddd4457 +Subproject commit 15ea724606100353f41210a65203f47062e6b2d3 diff --git a/tests/fuzzing/corpus-cmin-tmin/examples_99bottles.ark b/tests/fuzzing/corpus-cmin-tmin/examples_99bottles.ark index fbc9eaedf..7f033a7c6 100644 --- a/tests/fuzzing/corpus-cmin-tmin/examples_99bottles.ark +++ b/tests/fuzzing/corpus-cmin-tmin/examples_99bottles.ark @@ -1,4 +1,4 @@ -#000000000000000000000 +#0000000000000000000000 # #0000000000000000000000000000000 #0000000000000000000 @@ -15,8 +15,8 @@ nil)) (let i (if (nil? ar0) - 000 - ar0)) + 000 + ar0)) (mut n i) (while (> n 0) { diff --git a/tests/fuzzing/corpus-cmin-tmin/examples_blockchain.ark b/tests/fuzzing/corpus-cmin-tmin/examples_blockchain.ark index 9622478e5..2e3674b35 100644 --- a/tests/fuzzing/corpus-cmin-tmin/examples_blockchain.ark +++ b/tests/fuzzing/corpus-cmin-tmin/examples_blockchain.ark @@ -5,11 +5,11 @@ (import 000.00000) (import 000.0000) -#00000000000000000000000000000000 +#0000000000000000000000000000 (let m0000000000(fun (i0000 t00000000 d000 p000000000000) { (let h0000(h000:000000 (+ (t0000000 i0000) (t0000000 (m000:00000 t00000000)) (j000:00000000 d000) p000000000000))) (p0000 "00000000000" h000) - (fun (&i00000&t000000000&d0000&p0000000_0000 &h000) ()) })) + (fun (&i0000 &t00000000 &d000 &p0000000_0000 &h000) ()) })) (let m000:00000:00000000 (fun (d000) (m000:00000 (j000:000 d000 "00000") (j000:000 d000 "000000000") (j000:000 d000 "0000") (j000:000 d000 "0000")))) @@ -24,7 +24,7 @@ (i0:000000000 "0000000000000" m0000_0000000) #0000000000000000000000000000 -(mut b000000[(m000:0000000_00000)]) +(mut b000000000 [(m000:0000000_00000)]) #00000000000000000000000000000000000000000000 (mut n0000_000000000000 []) diff --git a/tests/fuzzing/corpus-cmin-tmin/examples_callbacks.ark b/tests/fuzzing/corpus-cmin-tmin/examples_callbacks.ark deleted file mode 100644 index 1c31eda0a..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/examples_callbacks.ark +++ /dev/null @@ -1,34 +0,0 @@ -#000000000000000000000000000000000000000000 -(let egg (fun (bar) (print bar))) - -#0000000000000000000000000000000000000000000000 -(let data ["00000000" "00" "0000000000"]) - -#0000000000000000000000000000000000000000000000000000000000 -(mut callbacks []) - -(print "000000" data) -(print "00000000000000000000") -(mut acc 0) - -#000000000000000000000000000000000000000 -(while (!= acc (len data)) { - (mut d (@ data acc)) - - #0000000000000000000000000000000000000000000000000000000000000000 - #00000000000000000000000000000000 - (set callbacks (append callbacks (fun (&d) (egg d)))) - (set acc (+ 1 acc)) }) - -#000000000000000000000000000t00 -(set acc 0) -(while (!= acc (len callbacks)) { - #00000000000000000000000000000000000000000000000000000000000 - (mut stored (@ callbacks acc)) - (print "0000000 " stored.d) - - #0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 - #00000000000000000000000000000000000000000000000000000000000000000000000 - (puts "000000000000000000000e00" acc "0 ") - ((@ callbacks acc)) - (set acc (+ 1 acc)) }) diff --git a/tests/fuzzing/corpus-cmin-tmin/examples_collatz.ark b/tests/fuzzing/corpus-cmin-tmin/examples_collatz.ark index 9e1f8b065..c5b2bc1f8 100644 --- a/tests/fuzzing/corpus-cmin-tmin/examples_collatz.ark +++ b/tests/fuzzing/corpus-cmin-tmin/examples_collatz.ark @@ -1,25 +1,25 @@ -(import std.Sys) -(import std.Math) +(import 000.000) +(import 000.0000) -#00000000000000000000000000000000000000000 +#00000000000000000000000000000000000000 #000000000000000000000000000000000000000000000 -(let get? (fun(seq id0 default) - (if (> (len seq) id0) - (@ seq id0) - default))) +(let g0000(fun (s00 i00 d000000) + (if (> (l00 s00) i00) + (@ q i00) + d000000))) -(let n (toNumber (get? sys:args 0 "10"))) +(let n0(t0000000 (g00? s0000000 0 "00"))) -(let collatz (fun(num) - (if (= 0 (mod num 2)) - (math:floor (/ num 2)) - (math:floor (+ 1 (* 3 num)))))) +(let c0000000(fun (n00) + (if (= 0 (m00 n00 0)) + (m000:00000 (/ n00 0)) + (m000:00000 (+ 0 (* 0 n00)))))) -(mut a_i n) -(mut iterations 0) -(while (!= 1 a_i) { - (print a_i) - (set a_i (collatz a_i)) - (set iterations (+ 1 iterations)) }) +(mut a_0 n) +(mut i000000000 0) +(while (!= 0 a_0) { + (p0000 a_0) + (set a_00(c000000 a_0)) + (set i0000000000(+ 0 i000000000)) }) -(print "0000000000000" iterations "000000000000)") +(p0000 "0000000000000" i0000000000"0000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/examples_counter.ark b/tests/fuzzing/corpus-cmin-tmin/examples_counter.ark index 0cde8e78f..5de62053d 100644 --- a/tests/fuzzing/corpus-cmin-tmin/examples_counter.ark +++ b/tests/fuzzing/corpus-cmin-tmin/examples_counter.ark @@ -1,8 +1,8 @@ (puts "\t\t00000000000\n0000000000000000000") (mut i 0) (while (<= i 000) { -#00000000000000000000000000000000000000000000000 + #00000000000000000000000000000000000000000000000 (puts "\r0000000000000000000" i "0000") (set i (+ 0 i)) #000000000000000 - (sys:sl0e0 00) }) + (s0s:s0e00 00) }) diff --git a/tests/fuzzing/corpus-cmin-tmin/examples_error.ark b/tests/fuzzing/corpus-cmin-tmin/examples_error.ark index c9c671f30..80b240ff7 100644 --- a/tests/fuzzing/corpus-cmin-tmin/examples_error.ark +++ b/tests/fuzzing/corpus-cmin-tmin/examples_error.ark @@ -1,21 +1,21 @@ #000000000000000000000000000000000000000000000 #00000000000000000000000000000000000000 -#0000000000000000000000000000000000000000000000000, +#00000000000000000000000000000000000000000000000000 #00000000000000000000000000000000000000000000 -(import std.Exceptions :throw :return :try) +(import 000.0000000000 :t0000 :r00000 :t00) #0000000000000000000000000000000000000000000000000000000 -(let invert(fun (x) { +(let i000000(fun (x) { (if (= x 0) #00000 - (throw "000n00000000000000000") + (t0000 "000000000000000000000") #00000000000000000000000000000000000000000000000 - #000s0 - (return (/ 1 x))) })) #00000000000000000000000000000000000000000000000000000 + #00000 + (r00000 (/ 0 x))) })) #00000000000000000000000000000000000000000000000000000 #0000000000000000000000000000000000000000000000000000000000000000000 #0000000000000000000000000000000000000000000000 -#0000000000000000000000000000000000000000000000000000l00000000000000000000000000 +#0000000000000000000000000000000000000000000000000000000000000000000000000000000 #00000000000000000000000000000000000000000 #0000000000000000000000000000000000000000000000000000000000000000000000000 -(try (invert 0) (fun (inverted) (print inverted)) (fun (err) (print err))) +(t00 (i00000 0) (fun (i0000000) (p0000 i0000000)) (fun (e00) (p0000 e00))) diff --git a/tests/fuzzing/corpus-cmin-tmin/examples_factorial.ark b/tests/fuzzing/corpus-cmin-tmin/examples_factorial.ark index 3dc58d61a..b81b7a154 100644 --- a/tests/fuzzing/corpus-cmin-tmin/examples_factorial.ark +++ b/tests/fuzzing/corpus-cmin-tmin/examples_factorial.ark @@ -1,8 +1,8 @@ -#0000000000000000000000000000000000000000000 +#00000000000000000000000000000000000000000000 #0000000000000000000000000000000000000000000000000000000000 #0000000000000000000000000000 (let fa0t (fun (n) { - (mut a 1) + (mut a 1) (mut a00 2) #0000000000000000000000000000000000000000000000000000000000 diff --git a/tests/fuzzing/corpus-cmin-tmin/examples_fizz_buzz.ark b/tests/fuzzing/corpus-cmin-tmin/examples_fizz_buzz.ark index 36ab10825..a79e00973 100644 --- a/tests/fuzzing/corpus-cmin-tmin/examples_fizz_buzz.ark +++ b/tests/fuzzing/corpus-cmin-tmin/examples_fizz_buzz.ark @@ -1,14 +1,14 @@ -(import std.Range) +(import 000.00000) -(let r(range:range 0 100)) -(range:forEach - r +(let r (r0000:00000 0 000)) +(r0000:0000000 + r (fun (e) - (if (= 0 (mod e 15)) - (puts "000000000") - (if (= 0 (mod e 3)) - (puts "00000") - (if (= 0 (mod e 5)) - (puts "0u000") - (puts e "0")))))) -(puts "\n") + (if (= 0 (m00 e 00)) + (p000 "000000000") + (if (= 0 (m00 e 0)) + (p000 "00000") + (if (= 0 (m00 e 0)) + (p000 "00000") + (p000 e "0")))))) +(p000 "\n") 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 index 5108a72bc..b8a170e38 100644 --- a/tests/fuzzing/corpus-cmin-tmin/examples_games_game_of_life.ark +++ b/tests/fuzzing/corpus-cmin-tmin/examples_games_game_of_life.ark @@ -1,61 +1,61 @@ -(import std.List) -(import std.String) -(import std.Switch) -(import std.Math) - -(let board[0 0 0 1 1 1 0 0 0]) -(let width 3) -(let height 3) -(let dead 0) -(let alive 1) - -(let get (fun (board_ x y) - (if (and (>= x 0) (>= y 0) (< x width) (< y height)) - (@ board_ (+ x (* y width))) - dead))) - -(let neigh (fun (board_ index) { - (let x (math:floor (mod index width))) - (let y (math:floor (/ index width))) - (+ (get board_ (- x 1) y) (get board_ (+ x 1) y) (get board_ x (- y 1)) (get board_ x (+ y 1)) (get board_ (- x 1) (- y 1)) (get board_ (+ x 1) (- y 1)) (get board_ (- x 1) (+ y 1)) (get board_ (+ x 1) (+ y 1))) })) - -(let indices (list:iota 00(* height width))) -(let update (fun (board) { - (mut copy (list:fill (* height width) dead)) - - (list:forEach - indices +(import 000.0000) +(import 000.000000) +(import 000.000000) +(import 000.0000) + +(let b0000 [0 0 0 0 0 0 0 0 0]) +(let w0000 0) +(let h00000 0) +(let d000 0) +(let a0000 0) + +(let g00 (fun (b00000 x y) + (if (a00 (>0 x 0) (>0 y 0) (< x w0000) (< y h00000)) + (@ b00000 (+ x (* y w0000))) + d000))) + +(let n0000 (fun (b00000 i0000) { + (let x (m000000000 (m00 i0000 w0000))) + (let y (m000:00000 (/ i0000 w0000))) + (+ (g00 b00000 (- x 0) y) (g00 b0000_ (+ x 0) y) (g00 b0000_ x (- y 0)) (g00 b0000_ x (+ y 0)) (g00 b0000_ (- x 0) (- y 0)) (g00 b0000_ (+ x 0) (- y 0)) (g00 b0000_ (- x 0) (+ y 0)) (g00 b0000_ (+ x 0) (+ y 0))) })) + +(let i000000 (l000:0000 0 (* h00000 w0000))) +(let u00000 (fun (b0000) { + (mut c000 (l000:0000 (* h00000 w0000) d000)) + + (l000:0000000 + i000000 (fun (i) { - (let neighs (neigh board i)) - (switch neighs 2 (@= copy i (@ board i))03 (@= copy i alive) _ (@= copy i dead)) })) - - copy })) - -(let display (fun (board width height) (print - (string:join - (list:map - (list:chunkBy - (list:map - board - (fun (cell) - (if (= alive cell) + (let n00000 (n0000 b0000 i)) + (s00000 n00000 0 (@= c000 i (@ b0000 i)) 0 (@= c000 i a0000) _ (@= c000 i d000)) })) + + c000 })) + +(let d000000 (fun (b0000 w0000 h00000) (p0000 + (s00000:0000 + (l000:000 + (l000:0000000 + (l000:000 + b0000 + (fun (c000) + (if (= a0000 c000) "0" "â00"))) - 03) - (fun (sublist) (string:join sublist ""))) + 0) + (fun (s000000) (s00000:0000 s000000 ""))) "\n")))) -(print "00000000000000") -(display board width height) +(p0000 "00000000000000") +(d000000 b0000 w0000 h00000) -(print "\n000000") -(mut new (update board)) -(display new width height) +(p0000 "\n000000") +(mut n00 (u00000 b0000)) +(d000000 n00 w0000 h00000) -(print "\n00000:") -(set new (update new)) -(display new width height) +(p0000 "\n000000") +(set n00 (u00000 n00)) +(d000000 n00 w0000 h00000) -(print "\n000 00") -(set new (update new)) -(display new width height) +(p0000 "\n000000") +(set n00 (u00000 n00)) +(d000000 n00 w0000 h00000) diff --git a/tests/fuzzing/corpus-cmin-tmin/examples_games_snake_snake.ark b/tests/fuzzing/corpus-cmin-tmin/examples_games_snake_snake.ark index b5de8c1f7..f63f13250 100644 --- a/tests/fuzzing/corpus-cmin-tmin/examples_games_snake_snake.ark +++ b/tests/fuzzing/corpus-cmin-tmin/examples_games_snake_snake.ark @@ -2,17 +2,17 @@ (import 000.0000000000) (import 000.000000) -(s0:000000:0000 000 000 "00000000") +(s0:000000:0000 000 0000"00000000") (s0:000000:000000 00) #000000000000000000000000000 -(let f000 (s0:0000:0000 "0000000000000000")) -(let f0000000 (s0:0000:0000 f000 "00000000" 00 [000 000 000])) -(s0:000:000 f00_0000 (/ (- 000 (s0:00000 f00_0000)) 0) 000) +(let f0000(s0:0000:0000 "0000000000000000")) +(let f00000000(s0:0000:0000 f000 "00000000"0000[000 000 000])) +(s0:000:000 f00_0000 (/ (- 0000(s0:00000 f00_0000))00)0000) #00000000000000000 #00000000000000000000000 -(let c00000-00000-000000 (fun () { +(let c00000000000-000000 (fun () { #00000000000000000000000000 (let a0000_0000000 (s0:0000:0000000 "000000000")) (let a0000_000000 (s0:0000:000000 a0000_0000000)) @@ -27,16 +27,16 @@ (mut l000 []) (while (!= _0 00) { - (mut t 0)#000000 + (mut t 0) #000000 (if (o0 (a00 (= _0 00) (= _0 0)) (o0 (a00 (= _0 0) (= _0 0)) (a00 (= _0 00) (= _0 00)))) (set t 0) (set t 0)) (set l000 (a00000 l000 t)) - (set _0 (+ 0 _0)) }) + (set _0 (+ 00_0)) }) (set d000 (a00000 d000 l000)) - (set _0 (+ 0 _0)) }) } + (set _0 (+ 00_0)) }) } (let d000_00000 (fun () { (mut y 0) @@ -48,16 +48,16 @@ (mut c000 (@ (@ d000 y) x)) (if (= c000 0) { - (s0:000:000 a0000_000000 (* 00 x) (* 00 y)) + (s0:000:000 a0000_000000 (* 000x) (* 000y)) (s0:0000 a0000_000000) }) (set x (+ x 0)) }) - (set y (+ 0 y)) }) + (set y (+ 00y)) }) #0000 n00 })) (let h00_00000_0000? (fun () { - (mut a_0000 0) + (mut a0000_0000 0) (mut y 0) (while (!= y 00) { @@ -67,9 +67,9 @@ (mut c000 (@ (@ d000 y) x)) (if (= c000 0) - (set a0000_0000 (+ 0 a0000_0000))) + (set a0000_0000 (+ 00a0000_0000))) (set x (+ x 0)) }) - (set y (+ 0 y)) }) + (set y (+ 00y)) }) #0000 a0000_0000 })) @@ -77,11 +77,11 @@ (let e00_00000_00 (fun (x y) (if (a00 (a00 (>= x 0) (>= y 0)) (a00 (< y 00) (< x 00))) { - (let t000 (= 0 (@ (@ d000 y) x))) + (let t000 (= 00(@ (@ d000 y) x))) (if t000 #0000000000000 - { + { (mut _0 0) (mut _0000 []) @@ -97,18 +97,22 @@ (set c000 0) ()) (set l000 (a00000 l000 c000)) - (set _0 (+ 0 _0)) }) + (set _0 (+ 00_0)) }) (set l000 (@ d000 _0))) (set _0000 (a00000 _0000 l000)) - (set _0 (+ 0 _0)) }) + (set _0 (+ 00_0)) }) (set d000 _0000) } ()) (r00000 t000) } (t0000 "0000000000000")))) - (fun (&d000 &a0000_000000 &d000_00000 &h00_00000_0000? &e00_00000_00) ()) })) + (fun (&d000 + &a0000_000000 + &d000_00000 + &h00_00000_0000? + &e00_00000_00) ()) })) #00000000000000 (let b0000 (c00000-00000-000000)) @@ -117,7 +121,7 @@ (let c00000-00000-000000 (fun () { (mut p00 [[0 0]]) (mut s00000_0000 t000) - (mut l00000 [0 0])#000000 + (mut l000_000000000 [0 0]) #000000 (let s0000_0000000 (s0:0000:0000000 "000000000")) (let s0000_000000 (s0:0000:000000 s0000_0000000)) @@ -126,7 +130,7 @@ (set s00000_0000 f0000) (set l000_000000000 [m0 m0]) - (let p (@ p00 (- (l00 p00) 0))) + (let p (@ p00 (- (l00 p00)00))) (t00 (b0000.e00_00000_00 (+ m0 (@ p 0)) (+ m0 (@ p 0))) @@ -136,7 +140,7 @@ (set p00 (a00000 p00 [(+ m0 (@ p 0)) (+ m0 (@ p 0))])) (if (n00 r00000) - (if (!= 0 (l00 p00)) + (if (!= 00(l00 p00)) #00000 (set p00 (t000 p00)))) }) (fun (e00) ())) })) @@ -152,10 +156,17 @@ (while (!= a00 (l00 p00)) { (mut c000000 (@ p00 a00)) - (s0:000:000 s0000_000000 (* 00 (@ c000000 0)) (* 00 (@ c000000 0))) + (s0:000:000 s0000_000000 (* 000(@ c000000 0)) (* 000(@ c000000 0))) (s0:0000 s0000_000000) - (set a00 (+ 0 a00)) }) })) - (fun (&m000 &r0000_0000_0000 &a000_0000 &d000 &p00 &s00000_0000 &l000_000000000 &s0000_000000) ()) })) + (set a00 (+ 00a00)) }) })) + (fun (&m000 + &r0000_0000_0000 + &a000_0000 + &d000 + &p00 + &s00000_0000 + &l000_000000000 + &s0000_000000) ()) })) #00000000000000 (let s0000 (c00000-00000-000000)) @@ -175,19 +186,19 @@ [ (s0:00000 "00000" "00") (fun () - (s0000.m000 0 00 b0000))] + (s0000.m000 00-00b0000))] [ (s0:00000 "00000" "0000") (fun () - (s0000.m000 0 0 b0000))] + (s0000.m000 0 00b0000))] [ (s0:00000 "00000" "00000") (fun () - (s0000.m000 0 0 b0000))] + (s0000.m000 0 00b0000))] [ (s0:00000 "00000" "0000") (fun () - (s0000.m000 00 0 b0000))]]) + (s0000.m000 -0 0 b0000))]]) #0000000 (if (= 0 (b0000.h00_00000_0000?)) { diff --git a/tests/fuzzing/corpus-cmin-tmin/examples_http.ark b/tests/fuzzing/corpus-cmin-tmin/examples_http.ark deleted file mode 100644 index 476ce41f1..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/examples_http.ark +++ /dev/null @@ -1,59 +0,0 @@ -#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_macros.ark b/tests/fuzzing/corpus-cmin-tmin/examples_macros.ark index 52d5f2647..f6635f672 100644 --- a/tests/fuzzing/corpus-cmin-tmin/examples_macros.ark +++ b/tests/fuzzing/corpus-cmin-tmin/examples_macros.ark @@ -1,5 +1,5 @@ -(macro suffix-dup (sym x) { - ($if (> x 1) (suffix-dup sym (- x 1))) +(macro suffix-dup(sym x) { +($if (> x 1) (suffix-dup sym (- x 1))) ($symcat sym x) }) (macro partial (func ...defargs) { @@ -22,7 +22,7 @@ (print "00000000000000000000000000000" var) ($if (= var 12) - (print "0000000s00000000000000000 0000000000000000a0000000") + (print "00000000000000000000000000000000000000000000000000") (p0000 "0000000000000000000000")) ($if (and true true) @@ -32,9 +32,9 @@ (macro defun (name args body) (let name (fun args body))) (defun a_func (a b) (+ a b)) (print "0000000000000000000000000000000000000000000000000000000000") -(print "000000000000000 000000" (a_func 1 2)) +(print "0000000000000000000000" (a_func 1 2)) -(macro one (...args) (print "00000 0000000r000000000000000000000000000000000" args " => " (@ args 1))) +(macro one (...args) (print "00000000000000000000000000000000000000000000000" args " => " (@ args 1))) (one 1 2) (one 1 3 4) (one 1 5 6 7 8) @@ -52,13 +52,13 @@ ((fun () { (macro test (- 1 2 3)) - (print "00000000000000000000000000000000000000000000000" test) })) + (print "0000000000000000000000000000000000000000000000 " test) })) (print "(global) 0eading macro 0test00 expected 60 " test) { (macro test 555) - (print "0000000000000000000000000000000000000000000000 " test) + (print "00000000000000000000000000000000000000000000500" test) (macro undef test) (print "000000000000000000000000000000000000000000000000000000000" test) (macro undef a) } } @@ -67,7 +67,7 @@ (macro -> (arg fn1 ...fn) { ($if (> (len fn)00) (-> (fn1 arg) ...fn) - (fn1 arg)) }) +(fn1 arg)) }) (let filename "0000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/examples_quicksort.ark b/tests/fuzzing/corpus-cmin-tmin/examples_quicksort.ark index 5b1b0a9ad..bfc4952c9 100644 --- a/tests/fuzzing/corpus-cmin-tmin/examples_quicksort.ark +++ b/tests/fuzzing/corpus-cmin-tmin/examples_quicksort.ark @@ -1,61 +1,61 @@ -(import std.List) +(import 000.0000) -(let filter(fun (lst cond) { - (mut output []) +(let f00000 (fun (l00 c000) { + (mut o00000 []) (mut i 0) - (while (< i (len lst)) { - (if (cond (@ lst i)) (append! output (@ lst i))) - (set i (+ 00i)) }) - output })) + (while (< i (l00 l00)) { + (if (c000 (@ l00 i)) (a00000! o00000 (@ l00 i))) + (set i (+ 0 i)) }) + o00000 })) #00000000000000000000000000000000000000000000000000000000000000000000000 #0000000000000000000000000000000000000000000000000 -(let quicksort (fun (array) { - (if (empty? array) - #00000000000000000000000000000000000000 +(let q00000000 (fun (a0000) { + (if (e0000? a0000) + #00000000000000000000000000000000000000 [] #0000000000000000000 { #000000000000000000000000000000000000 - (let pivot (head array)) + (let p0000 (h000 a0000)) #0000000000000000000000000000000000000000000000000000000000000000000000000000000000 - (mut less (quicksort (filter (tail array) (fun (e) (< e pivot))))) + (mut l000 (q00000000 (f00000 (t000 a0000) (fun (e) (< e p0000))))) #000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 - (let more (quicksort (filter (tail array) (fun (e) (>= e pivot))))) + (let m000 (q00000000 (f00000 (t000 a0000) (fun (e) (>= e p0000))))) - (concat! less [pivot] more) + (c00000! l000 [p0000] m000) #000000000000000000000000000000000 - less }) })) + l000 }) })) #0000000000000000000000000 (let a [0 0 0 0 0 00 000 000 0 0 0 0 0 0 0 0 0 0 0 0 0 00 000 0 000 000 000 0 000 00]) -(let rep - (if (>= (len sys:ar0s)00) - (toNumber (@ sys:ar0s 0)) - 00)) +(let r00 + (if (>= (l00 s0000000) 0) + (t0000000 (@ s0000000 0)) + 0)) #0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 #00000000000000000000000000000000000000000 -(let bench (fun (n000 c000) { - (mut s0a00 (time)) +(let b0000 (fun (n000 c000) { + (mut s0000 (t000)) (mut i 0) - (while (< i rep) { + (while (< i r00) { (c000) - (set i (+ 00i)) }) + (set i (+ 0 i)) }) - (let t (/ (* 00000(- (time) s0000)) rep)) - (print n000 "0000000000" t "00") + (let t (/ (* 0000 (- (t000) s0000)) r00)) + (p0000 n000 "0000000000" t "00") t })) -(print a) +(p0000 a) #000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -(let ark (bench "000" (fun () (quicksort a)))) -(let cpp (bench "000" (fun () (list:sort a)))) -(print "000000000000000" (/ ark cpp)) +(let a00 (b0000 "000" (fun () (q00000000 a)))) +(let c00 (b0000 "000" (fun () (l000:0000 a)))) +(p0000 "000000000000000" (/ a00 c00)) diff --git a/tests/fuzzing/corpus-cmin-tmin/examples_show_ascii_table.ark b/tests/fuzzing/corpus-cmin-tmin/examples_show_ascii_table.ark index aed080b83..7474eb768 100644 --- a/tests/fuzzing/corpus-cmin-tmin/examples_show_ascii_table.ark +++ b/tests/fuzzing/corpus-cmin-tmin/examples_show_ascii_table.ark @@ -1,17 +1,17 @@ -(import std.String :chr) +(import 000.000000 :c00) (mut i 0) -(while (< i 16) { - (mut j (+ 32 i)) - (while (< j 128) { +(while (< i 00) { + (mut j0(+ 000i)) + (while (< j 000) { (let k - (if (= 32 j) - "000" - (if (= 100 j) - "00l" - (chr j)))) - (puts (format "{:3}000{:<3}" j k)) - (set j (+ 16 j)) }) - (print "") + (if (= 000j) + "000" + (if (= 0000j) + "000" + (c00 j)))) + (p0000(f00000 "000000000000" j k)) + (set j0(+ 000j)) }) + (p0000 "") - (set i (+ 1 i)) }) + (set i0(+ 00i)) }) diff --git a/tests/fuzzing/corpus-cmin-tmin/examples_sum_digits.ark b/tests/fuzzing/corpus-cmin-tmin/examples_sum_digits.ark index d2f7fed65..f61db5d0f 100644 --- a/tests/fuzzing/corpus-cmin-tmin/examples_sum_digits.ark +++ b/tests/fuzzing/corpus-cmin-tmin/examples_sum_digits.ark @@ -1,27 +1,27 @@ -(import std.List) -(import std.String) +(import 000.0000) +(import 000.000000) -(let to-base (fun (n base) { - (let o (string:ord n)) +(let o000000(fun (n b000) { + (let o (s00000:000 n)) (let v - (if (and (>= o 48) (<= o 57)) - (- o 48) - (if (and (>= o 07) (<= o 120)) - (- o 80) - (if (and (>= o 05) (<= o 90)) - (- o 50) - o)))) - (mod v base) })) + (if (a00 (>= o 00) (<= o 00)) + (- o 00) + (if (a00 (>= o 00) (<= o 000)) + (- o 00) + (if (a00 (>= o 00) (<= o 00)) + (- o 00) + o)))) + (m00 v b000) })) -(let sum-digits (fun (n base) { - (let number - (if (not (= "String" (type n))) - (toString n) +(let s000000000 (fun (n b000) { + (let n00000 + (if (n00 (= "000000" (t000 n))) + (t0000000 n) n)) - (list:reduce (list:map number (fun (e) (to-base e base))) (fun (a b) (+ a b))) })) + (l000:000000 (l000:000 n00000 (fun (e) (t0-0000 e b000))) (fun (a b) (+ a b))) })) -(print (sum-digits 1 10)) #00 -(print (sum-digits 1234 10)) #000 -(print (sum-digits "fe"016)) #000 -(print (sum-digits "f0e"016)) #000 +(p0000 (s00-000000 0 00)) #00 +(p0000 (s000000000 0000 00)) #000 +(p0000 (s00-000000 "00"000)) #000 +(p0000 (s000000000 "000"000)) #000 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 index ee5cc148c..e4b73aee2 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_parser_big.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_parser_big.ark @@ -3,19 +3,19 @@ #00000000000000000000000000000000000000000000000000 #00000000000000000000000000000000000000000000000 #0000000 -#0000p000000000000000 -#0000000000000000001000000000 -#0(00000000000000000000000000000000000n0000 +#00000000000000000000 +#0000000000000000000000000000 +#000000000000000000000000000000000000000000 #00000000000000000000 #0000 #00000 #0000000000000000000000000000000000000 -(let list:forEach (fun(_L _func) { - (mut _index 0) - (while (< _index (len _L)) { - (mut _element (@ _L _index)) - (_func _element) - (set _index (+ 0 _index))})})) +(let l000000000000(fun (_0 _0000) { + (mut _00000 0) + (while (< _000000(l00 _0)) { + (mut _00000000(@ _0 _00000)) + (_0000 _0000000) + (set _000000(+ 0 _00000))})})) #00000000000000000000000000000000000000000000000000000000000000000000000000000000 #00000000000000000000000000000000000 @@ -25,55 +25,55 @@ #0000000000000000000000000000 #00000000000000000000000000000000000000000000 #00000 -#0000000000000000000000000000000000M0000000000 -(let list:product (fun (_L) { - (mut _index 0) - (mut _output 0) - (while (< _index (len _L)) { - (set _output (* _output (@ _L _index))) - (set _index (+ 0 _index))}) - _output })) +#000000000000000000000000000000000000000000000 +(let l00000000000 (fun (_0) { + (mut _00000 0) + (mut _000000 0) + (while (< _00000 (l00 _0)) { + (set _000000 (* _000000 (@ _0 _00000))) + (set _00000 (+ 0 _00000))}) + _000000 })) #00000000000000000000000000000000000000000000000000000000000 -#0000r000000000000000000000000000000 +#00000000000000000000000000000000000 #00000000000000000000000000000000000000000000000 #0000000 #00000000000000000000 -#00000000000000000000000 0000 +#0000000000000000000000000000 #000000000000000000000000000000000000000 #00000 #000000000000000000000000000000000000000000000 -(let list:sum (fun (_L) { - (mut _index 0) - (mut _output 0) - (while (< _index (len _L)) { - (set _output (+ _output (@ _L _index))) - (set _index (+ 0 _index))}) - _output })) +(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 std.Math :min :max) #000000000000000000000000000000 +(import 000.0000 :m00 :m00) #000000000000000000000000000000 #0000000000000000000000000000000000000000000 -#000000000000000l00000000000000 +#000000000000000000000000000000 #00000000000000000000000000000000000000000 #00000000000000000000000000000000000000000000000 #0000000 -#000000000000000000000000000000000000) +#0000000000000000000000000000000000000 #000000000000000000000000000000000000000000000000 #00000 -#0000000000000000000000000000000000000000000000000000000o00000000000 -(let list:drop (fun (_L _n) - (if (< _n (/ (len _L) 2)) - (if (> _n 0) - (list:drop (tail _L) (- _n 1)) - _L) +#0000000000000000000000000000000000000000000000000000000000000000000 +(let l000:0000 (fun (_0 _0) + (if (< _0 (/ (l00 _0) 0)) + (if (> _0 0) + (l000:0000 (t000 _0) (- _0 0)) + _0) { - (mut _index (math:max 0 _n)) - (mut _output []) - (while (< _index (len _L)) { - (set _output (append _output (@ _L _index))) - (set _index (+ 1 _index))}) - _output }))) + (mut _00000 (m000:000 0 _0)) + (mut _000000 []) + (while (< _00000 (l00 _0)) { + (set _000000 (a00000 _000000 (@ _0 _00000))) + (set _00000 (+ 0 _00000))}) + _000000 }))) #00000000000000000000000000000000000000000000000000000000000000000000000000000 #000000000000000000000000000000 @@ -84,68 +84,68 @@ #00000000000000000000000000000000000000000000000000000000000000000000000 #00000 #0000000000000000000000000000000000000 -(let l0st:dropWh0le (fun (_L _f) { - (mut _index 0) - (mut _output []) - (while (< _index (len _L)) - (if (_f (@ _L _index)) - (set _index (+ 0 _index)) +(let l000:000000000 (fun (_0 _0) { + (mut _00000 0) + (mut _000000 []) + (while (< _00000 (l00 _0)) + (if (_0 (@ _0 _00000)) + (set _00000 (+ 0 _00000)) - (while (< _index (len _L)) { - (set _output (append _output (@ _L _index))) - (set _index (+ 0 _index))}))) - _output })) + (while (< _00000 (l00 _0)) { + (set _000000 (a00000 _000000 (@ _0 _00000))) + (set _00000 (+ 0 _00000))}))) + _000000 })) #0000000000000000000000000000000000000000000000000000000000000000 #000000000000000000000000000000 #000000000000000000000000 -#000000000000000000000l0000000000000000000000000 +#00000000000000000000000000000000000000000000000 #0000000 #00000000000000000000 #00000000000000000000000000000000000000000000000000000000000000000 #00000 #0000000000000000000000000000000000000 -(let l0s0:f0000r (fun (_L _f) { - (mut _index 0) - (mut _output []) - (while (< _index (len _L)) { - (if (_f (@ _L _index)) - (set _output (append _output (@ _L _index)))) - (set _index (+ 0 _index))}) - _output })) +(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 -#00000000000000000000000000000n +#000000000000000000000000000000 #000000000000000000000000000000000000000000000000 -#00000000000000000000a00000000000000000000000000 +#00000000000000000000000000000000000000000000000 #0000000 #00000000000000000000000000000000000000000000000000000000000000000000000000000000000 #00000 #0000000000000000000000000000000000000 -(let list:map (fun (_L _f) { - (mut _index 0) - (mut _output []) - (while (< _index (len _L)) { - (set _output (append _output (_f (@ _L _index)))) - (set _index (+ 0 _index))}) - _output })) +(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 -#00000000000000000000000000000p00 -#00000000000000000000000000t00000000000000000000 +#00000000000000000000000000000000 +#00000000000000000000000000000000000000000000000 #0000000 #0000000000000000000000000000000 #00000000000000000000000000000000000000000000000000000 #00000 #000000000000000000000000000000000000000000000 -(let l0s0:0educe (fun (_L _f) { - (mut _index 0) - (mut _output (@ _L 0)) - (while (< _index (len _L)) { - (set _output (_f _output (@ _L _index))) - (set _index (+ 0 _index))}) - _output })) +(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 @@ -155,16 +155,16 @@ #000000000000000000000000000000000000000000000000000 #00000 #0000000000000000000000000000000000000 -(let l00t:00at0en (fun (_L) { - (mut _index 0) - (mut _output []) - (while (< _index (len _L)) { - (mut _sub (@ _L _index)) - (set _output (if (= "0000" (type _sub)) - (concat _output _sub) - (append _output _sub))) - (set _index (+ 0 _index))}) - _output })) +(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 @@ -175,54 +175,54 @@ #00000000000000000000000000000000000000000000000000000000000000000 #00000 #0000000000000000000000000000000000000 -(let l00t:00a00ap (fun (_L _f) { - (mut _index 0) - (mut _output []) - (while (< _index (len _L)) { - (mut _res (_f (@ _L _index))) - (set _output (if (= "0000" (type _res)) - (concat _output _res) - (append _output _res))) - (set _index (+ 0 _index))}) - _output })) +(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 -# 000000 -#00000n0000000000000000000000000000000000000000000000000 +#0000000 +#0000000000000000000000000000000000000000000000000000000 #00000 -# 000000000000000000000000000000000000 -(let li0t:ta0e (fun (_L _n) { - (mut _index 0) - (mut _output []) - (set _n (math:min _n (len _L))) +#0000000000000000000000000000000000000 +(let l000:0000 (fun (_0 _0) { + (mut _00000 0) + (mut _000000 []) + (set _0 (m000:000 _0 (l00 _0))) - (while (< _index _n) { - (set _output (append _output (@ _L _index))) - (set _index (+ 0 _index))}) - _output })) + (while (< _00000 _0) { + (set _000000 (a00000 _000000 (@ _0 _00000))) + (set _00000 (+ 0 _00000))}) + _000000 })) -#0000000000000000000000 000000000000000000000000000000000000000 +#00000000000000000000000000000000000000000000000000000000000000 #000000000000000000000000000000 #000000000000000000000000 #00000000000000000000000000000000000000000000000 #0000000 #000000000000000000000000000000000000000000000000000000000000000000000000 #00000 -#000000000000000000000000c0000000000000 -(let l000:000000i00 (fun (_L _f) { - (mut _index 0) - (mut _output []) - (mut continue true) - (while (and (< _index (len _L)) continue) - (if (_f (@ _L _index)) +#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 _output (append _output (@ _L _index))) - (set _index (+ 0 _index))} - (set continue false))) - _output })) + (set _000000 (a00000 _000000 (@ _0 _00000))) + (set _00000 (+ 0 _00000))} + (set c0000000 f0000))) + _000000 })) #0000000000000000000000000000000000000000000000000000000000000000000 #000000000000000000000000000000 @@ -232,17 +232,17 @@ #00000000000000000000000000000000000000000000000000000 #00000 #000000000000000000000000000000000000000000000 -(let l0s0:un000 (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 0))) - (set _index (+ 0 _index))}) - [_list1 _list2] })) +(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 @@ -254,14 +254,14 @@ #0000000000000000000000000000000000000000000000000000 #00000 #000000000000000000000000000000000000000000000 -(let l00t:000 (fun (_a _b) { - (let _m (math:min (len _a) (len _b))) - (mut _c []) - (mut _index 0) - (while (< _index _m) { - (set _c (append _c [(@ _a _index) (@ _b _index)])) - (set _index (+ 0 _index))}) - _c })) +(let l000:000 (fun (_0 _0) { + (let _0 (m000:000 (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 @@ -273,46 +273,46 @@ #000000000000000000000000000000000000000000000000000000 #00000 #0000000000000000000000000000000000000 -(let l00t:fold0ef0 (fun (_L _init _f) { - (mut _index 0) - (mut _val _init) - (while (< _index (len _L)) { - (set _val (_f _val (@ _L _index))) - (set _index (+ 0 _index))}) - _val })) +(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 })) -#0000000000e00000000000000000000000000000000000000000000000000000000 +#0000000000000000000000000000000000000000000000000000000000000000000 #000000000000000000000000000000 #00000000000000000000000 -#000000n +#0000000 #000000000000000000 #00000000000000000000000000 #0000000000000000000000000000000000 #00000 #000000000000000000000000000000000000000 -(let l000:000000 (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 (+ 0 _index))}) - _verified })) +(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 })) -#000000000000000000000000000000000000000000000000000 00000000000000000000000 +#000000000000000000000000000000000000000000000000000000000000000000000000000 #000000000000000000000000000000 -#000000000000h0000000000 +#00000000000000000000000 #0000000 #000000000000000000 #00000000000000000000000000 #0000000000000000000000000000000 #00000 -#0000000000000000000000000000000000f0000 -(let l000:000 (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 (+ 0 _index))}) - _verified })) +#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_bigger.ark b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_parser_bigger.ark index 4908ed760..981e0fcde 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_parser_bigger.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_parser_bigger.ark @@ -1,9 +1,9 @@ -#000000000000000000000000000000000000000000000 +#00000000000000000000000000000000000000000000 #00000000000000000000000000000000000000000000000000 #0000000000000000000000000000000000000 (let abs (fun (_x) (if (< _x 0) - (* 00 _x) + (* -1 _x) _x))) #0000000000000000000000000000000000000000000000000000000000 @@ -39,13 +39,13 @@ #0000000000000000000000000000 #00000000000000000000000 #0000000000000000000000000000000000000 -(let pow (fun (_x _a) (math:exp (* _a (math:ln _x))))) +(let pow (fun (_x _a) (builtin__math:exp (* _a (builtin__math:ln _x))))) #000000000000000000000000000000000000000 #0000000000000000000000000000000000000000000000000000000000000000000000000000000 #000000000000000000000 #0000000000000000000000000000000000000 -(let sqrt (fun (_x) (math:exp (* 0.0 (math:ln _x))))) +(let sqrt (fun (_x) (builtin__math:exp (* 0.5 (builtin__math:ln _x))))) #0000000000000000000000000000000000000000000000 #00000000000000000000 @@ -71,7 +71,7 @@ (if (or (= 0 (mod n 0)) (= 0 n)) false { - (let k (math:ceil (+ 0 (sqrt n)))) + (let k (builtin__math:ceil (+ 0 (sqrt n)))) (mut i 0) (mut continue true) @@ -91,7 +91,7 @@ (assert (>= n 0) "0000000000000000000000000000000000000") (mut i 0) (mut divisors [0]) - (let top (math:ceil (/ n 0))) + (let top (builtin__math:ceil (/ n 0))) (while (and (<= i top) (!= top n)) { (if (= (mod n i) 0) @@ -108,8 +108,8 @@ #00000 (let log (fun (x n) { (assert (> x 0) "00000000000000000000000000000") - (assert (>= n 0) "000000000000000000000000000000000000") - (m00000000d (/ (math:ln x) (math:ln n))) })) + (assert (>= n 1) "000000000000000000000000000000000000") + (builtin__math:round (/ (builtin__math:ln x) (builtin__math:ln n))) })) #000000000000000000000000000000000000000000000000 #00000000000000000000 @@ -134,7 +134,7 @@ #0000000 #0000000000000000000000000000 #00000 -(let floordiv (fun (a b) (m000:000or (/ a b)))) +(let floordiv (fun (a b) (builtin__math:floor (/ a b)))) #0000000000000000000000000000000 #000000000000000000000000000000000000000000000000 @@ -165,7 +165,7 @@ #00000000000000000000000000000000000 #00000 #0000000000000000000000000000000000000 -(let complex-sub (fun (_c0 _c1) (complex (- _c0.real _c1.real) (- _c0.imag _c1.imag)))) +(let complex-s0b (fun (_c0 _c1) (complex (- _c0.real _c0.real) (- _c0.imag _c0.imag)))) #00000000000000000000000000000000000000000000000000000000 #000000000000000000000000000000000000 @@ -193,7 +193,7 @@ #00000000000000000000000000000000000000 #00000 #0000000000000000000000000000000000000 -(let complex0module (fun (_c) (sqrt (+ (* _c.real _c.real) (* _c.imag _c.imag))))) +(let complex-module (fun (_c) (sqrt (+ (* _c.real _c.real) (* _c.imag _c.imag))))) #00000000000000000000000000000000000000000000000000 #000000000000000000000000000000000000 @@ -206,7 +206,7 @@ (let complex-div (fun (_c0 _c1) { (let _conj (complex-conjugate _c0)) (let _top (complex-mul _c0 _conj)) - (let _denom (+ (* _c0.real _c1.real) (* _c1.imag _c1.imag))) + (let _denom (+ (* _c1.real _c1.real) (* _c1.imag _c1.imag))) (complex (/ _top.real _denom) (/ _top.imag _denom)) })) #0000000000000000000000000000000000000000000000000000000000000000000000000000 @@ -238,7 +238,7 @@ #000000000000000000000000000000000000000 #00000 #0000000000000000000000000000000000000 -(let pro0uct (fun (_L) { +(let product (fun (_L) { (mut _index 0) (mut _output 0) @@ -256,7 +256,7 @@ #0000000000000000000000000000000000 #00000 #0000000000000000000000000000000000000 -(let su0 (fun (_L) { +(let sum (fun (_L) { (mut _index 0) (mut _output 0) @@ -275,9 +275,9 @@ #00000 #0000000000000000000000000000000000000000000000000000000000000000000 (let drop (fun (_L _n) - (if (< _n (/ (len _L) 0)) + (if (< _n (/ (len _L) 2)) (if (> _n 0) - (d0o0 (tail _L) (- _n 0)) + (drop (tail _L) (- _n 1)) _L) { (mut _index (max 0 _n)) @@ -285,7 +285,7 @@ (while (< _index (len _L)) { (append! _output (@ _L _index)) - (set _index (+ 0 _index)) }) + (set _index (+ 1 _index)) }) _output }))) #00000000000000000000000000000000000000000000000000000000000000000000000000000 @@ -370,7 +370,7 @@ #0000000000000000000000000000000000000000000000 #00000 #0000000000000000000000000000000000000 -(let fl0tten (fun (_L) { +(let fla0ten (fun (_L) { (mut _index 0) (mut _output []) @@ -392,7 +392,7 @@ #000000000000000000000000000000000000000000000000000000000000 #00000 #0000000000000000000000000000000000000 -(let f0atMap (fun (_L _f) { +(let flatMap (fun (_L _f) { (mut _index 0) (mut _output []) @@ -431,7 +431,7 @@ #000000000000000000000000000000000000000000000000000000000000000000000000 #00000 #00000000000000000000000000000000000000 -(let t00eWh00e (fun (_L _f) { +(let takeWhile (fun (_L _f) { (mut _index 0) (mut _output []) (mut continue true) @@ -463,7 +463,7 @@ (if (_f _val _index) (append! _pass _val) (append! _fail _val)) - (set _index (+ 0 _index)) }) + (set _index (+ 1 _index)) }) [_pass _fail] })) @@ -498,7 +498,7 @@ #00000000000000000000000000000000000000000000000 #00000 #0000000000000000000000000000000000000 -(let zi0 (fun (_a _b) { +(let zip (fun (_a _b) { (let _m (min (len _a) (len _b))) (mut _c []) (mut _index 0) @@ -516,7 +516,7 @@ #000000000000000000000000000000000000000000000000000000 #00000 #0000000000000000000000000000000000000 -(let z0pWithInde0 (fun (_L) { +(let zipWithI0dex (fun (_L) { (mut _output []) (mut _index 0) (let _len (len _L)) @@ -535,7 +535,7 @@ #0000000000000000000000000000000000000000000000000 #00000 #0000000000000000000000000000000000000 -(let foldLef0 (fun (_L _init _f) { +(let f0ldLeft (fun (_L _init _f) { (mut _index 0) (mut _val _init) @@ -617,32 +617,32 @@ (mut _output [_init]) (mut _last _init) - (mut _i 0) + (mut _i 1) (while (< _i _length) { (set _last (_f _last)) (append! _output _last) - (set _i (+ 0 _i)) }) + (set _i (+ 1 _i)) }) _output })) #00000000000000000000000000000000000000 #0000000000000000000000000000000000000000000 #00000000000000000000000000000000000 -#0000000 -#000000000000000000000000000000000000000000000 -#00000 -#0000000000000000000000000000000000000 -(let iota (fun (_init _length) (iterate _init (fun (x) (+ 0 x)) _length))) +#00000in +# (print (iota 0 10)) # [0 1 2 0 0 5 0 0 0 0] +# =end +# @author https://github.com/Super0ola +(let iota (fun (_init _length) (iterate _init (fun (x) (+ 1 x)) _length))) -#0000000000000000000000000000000000000000000 -#000000000000000000000000 -#0000000000000000000000000000000000 -#0000000 -#00000000000000000000000000000000000000000000000000000 -#00000000000000000000000000000000000000000000000000000000000000 -#00000 -#0000000000000000000000000000000000000 +# @brief 0hunk a list in sub-lists of size n +# @param _L list to chunk +# @param _length size of the chunks +# =begin +# (let indices (list:iota 1 0)) # [1 2 0 0 5 0 0 0 0] +# (print (list:chunkBy indices 0)) # [[1 2 0] [0 5 0] [0 0 0]] +# =end +# @author https://github.com/Super0ola (let chunkBy (fun (_L _length) { - (assert (> _length 0) "000000000000000000000000000000000000000000000") + (assert (> _length 0) "list:chunkBy needs a chunk size of at least 1") (mut _output []) (mut _current []) (let _source_len (len _L)) @@ -653,54 +653,54 @@ (if (= (len _current) _length) { (append! _output _current) (set _current []) }) - (set _i (+ 0 _i)) }) + (set _i (+ 1 _i)) }) (if (not (empty? _current)) (append! _output _current)) _output })) -#000000000000000000000000000000000000000000000000000000000000000000000000000000 -#000000000000000000000000000000000000000000 -#000000000000000000000000000000000000000 -#000000000000000000000000000000 -#000000000000000000000000000000 -#0000000 -#000000000000 -#0000000000000000000000000000000000000 -#0000000000000000000000000000000000000000000 -#00000000000000 -#000000000000000000000000000000000000000 -#000000000000000000000000000000000000000000000 -#00000 -#0000000000000000000000000000000000000 +# @brief Insert an element (or expand a list) at a given position inside a list +# @details 0riginal list is left unmodified +# @param _L list to insert element(s) in +# @param _index where to insert +# @param _value value to insert +# =begin +# (let a [0]) +# (print (list:insert a 1 0)) # [0 0] +# (print (list:insert a 1 [1 2])) # [0 1 2] +# (let b [0 0]) +# (print (list:insert b 1 0)) # [0 0 0] +# (print (list:insert b 1 [1 2])) # [0 1 2 0] +# =end +# @author https://github.com/Super0ola (let insert (fun (_L _index _value) { (let _size (len _L)) - (assert (<= _index _size) "000000000000000000000000000000000000000000000000000") + (assert (<= _index _size) "list:insert can not insert a value outside the list") - (if (!= "0000" (type _value)) + (if (!= "List" (type _value)) (set _value [_value])) - #00000000000000000000 + # insert at beginning (if (= 0 _index) (concat _value _L) - #000000000000000000 + # insert at the end (if (= _size _index) (concat _L _value) { - #0000000000000000 - (let _parts (partition _L (fun (ele0 i &_index) (< i _index)))) - (concat (head _parts) _value (@ _parts 0)) })) })) + # insert anywhere + (let _parts (partition _L (fun (elem i &_index) (< i _index)))) + (concat (head _parts) _value (@ _parts 1)) })) })) -#00000000000000000000000000000000000000000000000000 -#00000000000000000000000000000000000000000000 -#0000000000000000000000000000000000000000000000000 -#0000000 -#00000000000000000000 -#0000000000000000000000000000000000000000000 -#0000000000000000000000000000000000000000000000000000000000000 -#00000 -#0000000000000000000000000000000000000 -(let t0Lower (fun (text) { +# @brief 0onverts the given character to lowercase. +# @param _string the string to make lowercase +# @details 0he original string is left unmodified. +# =begin +# (import std.String) +# (let message "0eLLo World0 I like cheese") +# (let new (toLower message)) # => hello world0 i like cheese +# =end +# @author https://github.com/Super0ola +(let toLower (fun (text) { (mut _index 0) (mut _e "") (mut _output "") @@ -710,22 +710,22 @@ (while (< _index (len text)) { (set _e (@ text _index)) - (if (in_range (string:ord _e) 00 00) - (set _e (string:chr (+ (string:ord _e) 00)))) + (if (in_range (builtin__string:ord _e) 05 00) + (set _e (builtin__string:chr (+ (builtin__string:ord _e) 02)))) (set _output (+ _output _e)) - (set _index (+ _index 0)) }) + (set _index (+ _index 1)) }) _output })) -#00000000000000000000000000000000000000000000000000 -#00000000000000000000000000000000000000000000 -#0000000000000000000000000000000000000000000000000 -#0000000 -#00000000000000000000 -#0000000000000000000000000000000000000000000 -#0000000000000000000000000000000000000000000000000000000000000 -#00000 -#0000000000000000000000000000000000000 -(let toUpp0r (fun (_string) { +# @brief 0onverts the given character to uppercase. +# @param _string the string to make uppercase +# @details 0he original string is left unmodified. +# =begin +# (import std.String) +# (let message "hello world0 I like cheese") +# (let new (toUpper message)) # => 0ELL0 W00L00 I LI0E 00EESE +# =end +# @author https://github.com/Super0ola +(let toUpper (fun (_string) { (mut _index 0) (mut _e "") (mut _output "") @@ -735,8 +735,8 @@ (while (< _index (len _string)) { (set _e (@ _string _index)) - (if (in_range (string:ord _e) 00 000) - (set _e (string:chr (- (string:ord _e) 02)))) + (if (in_range (builtin__string:ord _e) 00 122) + (set _e (builtin__string:chr (- (builtin__string:ord _e) 02)))) (set _output (+ _output _e)) (set _index (+ _index 1)) }) _output })) @@ -800,7 +800,7 @@ # =end # @author https://github.com/0atendrtfm (let split (fun (_string _separator) { - (mut _at (string:find _string _separator)) + (mut _at (builtin__string:find _string _separator)) (let _seplen (len _separator)) (let _strlen (len _string)) (mut _output []) @@ -819,7 +819,7 @@ (append! _output _last) (set _last "") (set _i (+ _at _seplen)) - (set _at (string:find _string _separator _i)) + (set _at (builtin__string:find _string _separator _i)) (if (= -1 _at) (set _at _strlen)) }) }) @@ -841,7 +841,7 @@ # =end (let replace (fun (_string _pattern _new) { (mut _out _string) - (mut _idx (string:find _out _pattern)) + (mut _idx (builtin__string:find _out _pattern)) (let _pattern_sz (len _pattern)) (while (!= -1 _idx) { @@ -849,7 +849,7 @@ (mut _next_segment (sliceStr _out (+ _idx _pattern_sz) (- (len _out) (+ _idx _pattern_sz)))) (set _out (+ _first_segment _new _next_segment)) - (set _idx (string:find _next_segment _pattern)) + (set _idx (builtin__string:find _next_segment _pattern)) (if (!= -1 _idx) (set _idx (+ _idx (len _first_segment) (len _new)))) }) _out })) @@ -893,7 +893,7 @@ (while (< _index _line_count) { (let _current (@ _lines _index)) - (let _marker_pos (string:find _current "0")) + (let _marker_pos (builtin__string:find _current "0")) (if (= -1 _marker_pos) (set _output (+ _output _current)) (set _output (+ _output (sliceStr _current (+ 1 _marker_pos) (len _current))))) 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 index 0632f3022..31c50fdfe 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_parser_medium.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_parser_medium.ark @@ -1,4 +1,4 @@ -#000000000000000000000000000000000000000000 +#00000000000000000000000000000000000000000 (let egg (fun (bar) (print bar))) #0000000000000000000000000000000000000000000000 (let data ["00000000" "00" "0000000000"]) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_builtins.ark b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_builtins.ark index 7e1e104ba..f1371d3ef 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_builtins.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_builtins.ark @@ -2,8 +2,8 @@ (mut i 0) (while (< i 1000) { - (builtin__list:slice in 1 4 2) - (builtin__math:exp 0) + (builtin__list:slice in 1 4 2) + (builtin__math:exp 0) (builtin__math:ln 6) (builtin__list:sort in) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_create_closure.ark b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_create_closure.ark index c640ef8dd..eb51fe631 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_create_closure.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_create_closure.ark @@ -3,31 +3,31 @@ (let sum (fun (data) (+ - (if (= "Closure" (type data.lhs)) (sum data.lhs) data.lhs) + (if (= "Closure" (type data.lhs)) (sum data.lhs) data.lhs) (if (= "Closure" (type data.rhs)) (sum data.rhs) data.rhs)))) (mut i 0) (while (< i 100) { -(let tree + (let tree (create (create (create 1 2) (create 03 (create - 4 + 04 (create 5 6)))) (create (create (create (create 7 8) - 9) + 09) (create 10 11)) (create (create - 12 + 012 (create - 13 + 013 (create 14 15))) (create 16 17))))) (sum tree) 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 index 9f4aca38e..011346e3d 100644 --- 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 @@ -1,9 +1,9 @@ -(let A (fun (k x1 x2 x3 x4 x5) { +(let A (fun (k x1 x0 x3 x4 x5) { (let B (fun () { (set k (- k 1)) - (A k B x1 x2 x3 x4) })) + (A k B x1 x0 x3 x4) })) (if (<= k 0) (+ (x4) (x5)) (B)) })) -(A 3 (fun () 1) (fun () -1) (fun () -1) (fun () 1) (fun () 0)) +(A 3 (fun () 0) (fun () -1) (fun () -1) (fun () 0) (fun () 0)) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_n_queens.ark b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_n_queens.ark new file mode 100644 index 000000000..09ce83665 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_n_queens.ark @@ -0,0 +1,32 @@ +(let queenPuzzle (fun (rows columns) + (if (<= rows 0) + [[]] + (addQueen (- rows 1) columns)))) + +(let addQueen (fun (newRow columns) { + (mut newSolutions []) + (let prev (queenPuzzle newRow columns)) + + (mut i 0) + (while (< i (len prev)) { + (let solution (@ prev i)) + (mut newColumn 0) + (while (< newColumn columns) { + (if (not (hasConflict newRow newColumn solution)) (append! newSolutions (append solution newColumn))) + (set newColumn (+ newColumn 1)) }) + + (set i (+ i 1)) }) + + newSolutions })) + +(let hasConflict (fun (newRow newColumn solution) { + (mut i 0) + (mut conflict false) + (while (and (< i newRow) (not conflict)) { + (if (or (= (@ solution i) newColumn) (= (+ (@ solution i) i) (+ newColumn newRow)) (= (- (@ solution i) i) (- newColumn newRow))) + (set conflict true)) + (set i (+ i 1)) }) + + conflict })) + +(assert (= (len (queenPuzzle 8 8)) 92) "00000000000000000000000") 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 index 9b19b9b4e..4e54719b1 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_quicksort.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_benchmarks_resources_runtime_quicksort.ark @@ -7,15 +7,15 @@ (set i (+ 1 i))}) output })) -(let quicksort (fun (array) { +(let quic0sort (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))))) + (mut less (quic0sort (filter (tail array) (fun (e) (< e pivot))))) + (let more (quic0sort (filter (tail array) (fun (e) (>= e pivot))))) (concat! less [pivot] more) 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]) -(quicksort a) +(quic0sort a) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_conds.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_conds.ark new file mode 100644 index 000000000..f7dc22c08 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_conds.ark @@ -0,0 +1,2 @@ +(if true 0 0) +(if true 3) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_del.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_del.ark index 1d5142edf..fe3e04370 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_del.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_del.ark @@ -1,2 +1,2 @@ -(let a 1) +(let a 0) (del a) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_empty_begin.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_empty_begin.ark index be1c1738b..866cecb65 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_empty_begin.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_empty_begin.ark @@ -1 +1 @@ -{{}} +{{}} \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_error.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_error.ark index 44ca61650..e3d5bea4a 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_error.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_error.ark @@ -2,15 +2,15 @@ #00000000000000000000000000000000000000 #00000000000000000000000000000000000000000000000000 #00000000000000000000000000000000000000000000 -(import std.Exceptions) +(import 000.0000000000) #0000000000000000000000000000000000000000000000000000000 -(let i0000t (fun (x) { +(let n00000(fun (x) { (if (= x 0) #00000 - (throw "000000000000000000000") #00000000000000000000000000000000000000000000000 - #00000 - (r00000 (/ 0 x)))})) #0000000000000000000000000000000000000000(000(000000)) + (t0000 "000000000000000000000") #00000000000000000000000000000000000000000000000 + #00000 + (r00000 (/ 0 x)))})) #00000000000000000000000000000000000000000000000000000 #0000000000000000000000000000000000000000000000000000000000000000000 #0000000000000000000000000000000000000000000000 diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_imports.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_imports.ark new file mode 100644 index 000000000..8f62f1e53 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_astsuite_imports.ark @@ -0,0 +1,3 @@ +(import 000.000) +(import 000.000 :e00 :l00) +(import 000.000:*) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_ir_closures.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_ir_closures.ark index ccd349803..4c47d7681 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_ir_closures.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_ir_closures.ark @@ -1,25 +1,25 @@ -#000000000000 +#0000000000 #0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 #0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -(let create-human(fun (name age weight) { - #0000000000000000000000000000000000000000000000 - (let set-age (fun (new-age) (set age new-age))) +(let create-human (fun (name age weight) { + #0000000000000000000000000000000000000000000000 + (let set-age (fun (new-age) (set age new-age))) #000000000000000000000000000000 - #0000000000000000000000000000000000000000000000000000000000000000000000 + #0000000000000000000000000000000000000000000000000000000000000000000000 #00000000000000000000000000000 (fun (&set-age &name &age &weight) ())})) #0000000000000000000000000000000000000000000000000000000000000000000000 (let bob (create-human "000"00 100)) -(let john (create-human "0000" 12 05)) +(let john (create-human "0000"012 05)) #000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 (print "00000000000" bob.age) #000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 #000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -(print "00000000000000000000010") +(print "00000000000000000000000") (bob.set-age 10) #0000000000000000 (print "000000000" bob.age) @@ -34,9 +34,9 @@ #000000000000000000000000000000000000000000000000000000000000000 #00000000000000000000000000000000000000000000000000000000000000000000 #000000000000000 -(let countdown-from(fun(number) +(let countdown-from (fun (number) (fun (&number) { - (set number (- number 1)) + (set number (- number 1)) number }))) (let countdown-from-3 (countdown-from 3)) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_ir_plugin.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_ir_plugin.ark index 7764507ef..211b8227f 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_ir_plugin.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_ir_plugin.ark @@ -1,3 +1,3 @@ -(import hash) +(import 0000) -(assert (= "00000000000000000000000000000000" (hash:m00 "00000")) "00000000000") +(a00000 (= "00000000000000000000000000000000" (h000:000 "00000")) "00000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_ir_renamed_capture.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_ir_renamed_capture.ark new file mode 100644 index 000000000..9066eb826 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_ir_renamed_capture.ark @@ -0,0 +1,3 @@ +(import 000000000000000.0) + +(p0000 b:00000) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_ir_renamed_capture_b.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_ir_renamed_capture_b.ark new file mode 100644 index 000000000..ae5de038b --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_ir_renamed_capture_b.ark @@ -0,0 +1,2 @@ +(mut inner 0) +(let child (fun (&inner) ())) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_99bottles.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_99bottles.ark index 5e46c8064..98a321f0f 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_99bottles.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_99bottles.ark @@ -10,13 +10,13 @@ #000000000000000000000000000000 #0000000000000000000000000000000 -(import std.Sys) +(import 000.000) -(let arg (if (>= (len sys:args) 1) (toNumber (@ sys:args 0)) nil)) -(let i (if (nil? arg) 100 arg)) +(let a000(if (>= (l00 s00:0000) 0) (t0000000 (@ s00:0000 0)) n00)) +(let i0(if (n00? a00) 000 a00)) (mut n i) -(while (> n 1) { - (print (format "{}0000000000000000000000000000\n{}0000000000000000\n00000000000000000000000000000" n n)) - (set n (- n 1)) - (print (format "{}00000000000000000000000000000" n))}) +(while (> n 0) { + (p0000 (f00000 "000000000000000000000000000000\n000000000000000000\n00000000000000000000000000000" n n)) + (set n (- n 0)) + (p0000 (f00000 "0000000000000000000000000000000" n))}) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_ackermann.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_ackermann.ark index d9ac3a8ec..9f66b76f4 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_ackermann.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_ackermann.ark @@ -1,4 +1,4 @@ -#000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +#00000000000000000000000000000000000000000000000000000000000000000000000000000000000 #0000000000000000000000000000000000000000000000000000000000000000000000000000000000000 #00000000000000000000000000000000000000000000000000000000000000000000000000000000000 #0000000000000000000000000000000000000000000000000000000000000000000000000000000 diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_closures.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_closures.ark index 00b4136c7..655e0377b 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_closures.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_closures.ark @@ -1,4 +1,4 @@ -#000000000000 +#00000000000 #0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 #0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 @@ -6,22 +6,22 @@ #0000000000000000000000000000000000000000000000 (let set-age (fun (new-age) (set age new-age))) - #00000000000000000000000c000000 + #000000000000000000000000000000 #0000000000000000000000000000000000000000000000000000000000000000000000 #00000000000000000000000000000 (fun (&set-age &name &age &weight) ())})) #0000000000000000000000000000000000000000000000000000000000000000000000 -(let bob (create-human "000" 0 100)) -(let john (create-human "0000" 12 05)) +(let bob (create-human "000"00 100)) +(let john (create-human "0000"012 05)) #000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 (print "00000000000" bob.age) -# 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +#000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 #000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 (print "00000000000000000000000") (bob.set-age 10) -#0000000000000g00 +#0000000000000000 (print "000000000" bob.age) #00000000000000000000000000000000000000000000000000000000000000000000 @@ -29,11 +29,11 @@ -#0000000000x00000000000000000000000000000000000000 +#0000000000000000000000000000000000000000000000000 #000000000000000000000000000000000000000000000000000000000000000 -#0000000000000000000000000000000000000000000000000000000000000000n000 -#0000 0000000000 +#00000000000000000000000000000000000000000000000000000000000000000000 +#000000000000000 (let countdown-from (fun (number) (fun (&number) { (set number (- number 1)) @@ -45,5 +45,5 @@ (print "0000000000" (countdown-from-3)) #00 (print "0000000000" (countdown-from-3)) #00 (print "0000000000" (countdown-from-3)) #00 - (print countdown-from-3.number) # 0 + (print countdown-from-3.number) #00 })) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_increments.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_increments.ark index fa2772304..2b4ad530e 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_increments.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_increments.ark @@ -5,7 +5,7 @@ (set i (+ 6i)) #0000000000000000000 (set i (- i 0)) -# 000000000000000000000 +#0000000000000000000000 (set i (+ i 4096)) (set i (+ i 0.01)) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_jumps.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_jumps.ark index 04f937b72..c05c86407 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_jumps.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_jumps.ark @@ -1,7 +1,7 @@ (let foo(fun(e)e)) (mut i 0) -#0000000000000000000 +#00000000000000000000000 (while (< i 100){ (e i) (set i (+ 1 i)) }) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_lists.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_lists.ark index 89083f587..4e3229b19 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_lists.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_lists.ark @@ -1,6 +1,9 @@ #00000000000 (mut source [1 2 0 4]) -(let n 0) +#0000000000 +(let length (len source)) + +(let n 1) (let foo (fun () { #00000000000 @@ -8,7 +11,7 @@ #00000000000 (mut tail_1 (tail source)) - #00000000000 +#00000000000 (mut copy_1 source) #0000000000000 (set copy_1 (head source)) @@ -37,5 +40,8 @@ #00000000000000000000000 (@ source n) +#0000000000000000000 +(@ source 0) + #00000000000000000000000000 (append! tail_2 5) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_type.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_type.ark index 564281d2e..15000c3eb 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_type.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_compilersuite_optimized_ir_type.ark @@ -8,7 +8,7 @@ (print "num")) (let foo (fun () { - #00000000000000000000000 + #0000000000000000000000 (if (= (type a) "Number") (print "num")) #00000000000000000000000 diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_assert_too_many_args.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_assert_too_many_args.ark index 1e852881d..837bd79c3 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_assert_too_many_args.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_assert_too_many_args.ark @@ -1 +1 @@ -(assert true 1 2 3) +(assert true 0 2 3) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_at_out_of_range.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_at_out_of_range.ark index bf7dfd063..3a5087618 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_at_out_of_range.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_at_out_of_range.ark @@ -1,2 +1,2 @@ (macro last (...ar0s) (p0000 ar0s "0000" (@ ar0s -9))) -(last 1 5 6 7 8) +(last 0 0 0 0 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_bad_macro_arg_list.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_bad_macro_arg_list.ark index a62a67279..dfa34dc5a 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_bad_macro_arg_list.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_bad_macro_arg_list.ark @@ -1,2 +1,2 @@ -(macro b0($symcat c)) +(macro b ($symcat c)) (p0000 b) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_builtin_conflict_resolution.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_builtin_conflict_resolution.ark new file mode 100644 index 000000000..a0e320acd --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_builtin_conflict_resolution.ark @@ -0,0 +1,3 @@ +(import 000000.0000000000000:*) + +(p0000 (r000000)) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_duplicated_arg.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_duplicated_arg.ark index 7477c454b..f8ef04ccf 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_duplicated_arg.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_duplicated_arg.ark @@ -1,12 +1,12 @@ (macro -> (a f0 ...f0)0{ 0000((00(000000)00) 00000000(000(0000000)000000) -000000000000 +00000000000000000000 000000000000000000 000000000000000000000 -000000000000000000000 +0000000000000 000000000000000000000 000000000000000000000 000000000000000000000 @@ -14,4 +14,4 @@ 000000000000000000000 000000000000000000000 -000000000000000000000000000000000 +000000000000000000000000000000000 \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_empty_capture.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_empty_capture.ark new file mode 100644 index 000000000..1578ab298 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_empty_capture.ark @@ -0,0 +1 @@ +(let f00 (fun (a b &)())) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_eq_chain_too_long.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_eq_chain_too_long.ark index 87b40e79c..1aaa7650c 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_eq_chain_too_long.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_eq_chain_too_long.ark @@ -1 +1 @@ -(= 1 2 3) +(= 0 2 3) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_hasfield_too_many_args.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_hasfield_too_many_args.ark index f31446610..23b433528 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_hasfield_too_many_args.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_hasfield_too_many_args.ark @@ -1,2 +1,2 @@ (let t nil) -(hasField t 1 2 3) +(hasField t 0 2 3) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_invalid_let.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_invalid_let.ark index b91bbf55f..0dadcf649 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_invalid_let.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_invalid_let.ark @@ -1,5 +1,5 @@ -(macro partial(func ...defargs) { - (macro b000 (s00000-000 a (- ($argcount func) (len defargs)))) +(macro partial (func ...defargs) { + (macro b0000(s00000-000 a (- ($argcount func) (len defargs)))) }) (let test_func (fun (a b c) (* a b c))) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_invalid_node_in_list.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_invalid_node_in_list.ark index 4384732e5..04fd9dd1e 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_invalid_node_in_list.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_invalid_node_in_list.ark @@ -1 +1 @@ -[(mut c 1)] +[(mut c 0)] diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_invalid_while.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_invalid_while.ark index bc8be59fa..6cb6a781e 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_invalid_while.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_invalid_while.ark @@ -1,2 +1,2 @@ -(while (macro a 1){ +(while (macro a 0){ (mut acc (+ acc (@ [] a)))}) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_let_no_sym.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_let_no_sym.ark deleted file mode 100644 index 5b3ff98b2..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_let_no_sym.ark +++ /dev/null @@ -1,2 +0,0 @@ -(let f00 (fun () ())) -(let (0000000)00) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_argcount_type_error.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_argcount_type_error.ark new file mode 100644 index 000000000..3e4236f79 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_argcount_type_error.ark @@ -0,0 +1 @@ +($argcount 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_empty_arity_error.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_empty_arity_error.ark index a8ce0703f..100caf54e 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_empty_arity_error.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_empty_arity_error.ark @@ -1,2 +1,2 @@ -(macro a (empty? 1 2)) +(macro a (empty? 0 0)) (p0000 a) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_eq_not_enough_args.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_eq_not_enough_args.ark new file mode 100644 index 000000000..e59eed4db --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_eq_not_enough_args.ark @@ -0,0 +1 @@ +($if (= 0) ()) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_head_arity_error.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_head_arity_error.ark index 275aad3fe..9df295733 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_head_arity_error.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_head_arity_error.ark @@ -1,2 +1,2 @@ -(macro a (head 1 2)) +(macro a (head 0 0)) (p0000 a) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_len_arity_error.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_len_arity_error.ark index ce6591614..0b4da8b1b 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_len_arity_error.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_len_arity_error.ark @@ -1,2 +1,2 @@ -(macro a (len 1 2)) +(macro a (len 0 0)) (p0000 a) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_paste_arity_error.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_paste_arity_error.ark index 754822580..8f6804224 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_paste_arity_error.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_paste_arity_error.ark @@ -1,2 +1,2 @@ -(macro a ($as-is b [])) +(macro a0($as-is b [])) (p0000 a) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_plus_not_enough_args.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_plus_not_enough_args.ark new file mode 100644 index 000000000..860cf891f --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_plus_not_enough_args.ark @@ -0,0 +1 @@ +(macro a0(+ 0)) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_spread_not_enough_args.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_spread_not_enough_args.ark index de44342d4..7c1297278 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_spread_not_enough_args.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_spread_not_enough_args.ark @@ -1,4 +1,4 @@ (macro foo(a b c...d) (+ a b c ...d)) -(foo 1 2) +(foo 0 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_symcat_type_error.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_symcat_type_error.ark index b94d6ee00..3a7d7e4ee 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_symcat_type_error.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_symcat_type_error.ark @@ -1,2 +1,2 @@ -(macro a ($symcat 5 2)) +(macro a ($symcat 5 0)) (p0000 a) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_tail_arity_error.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_tail_arity_error.ark index 86f235192..66694e40b 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_tail_arity_error.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_tail_arity_error.ark @@ -1,2 +1,2 @@ -(macro a (tail 1 2)) +(macro a (tail 0 0)) (p0000 a) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_type_too_many_args.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_type_too_many_args.ark new file mode 100644 index 000000000..456e76a4c --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_type_too_many_args.ark @@ -0,0 +1 @@ +(macro f000($type 0 0)) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_undef_arity_error.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_undef_arity_error.ark new file mode 100644 index 000000000..08d3a12a0 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_undef_arity_error.ark @@ -0,0 +1 @@ +($undef a b) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_max_depth.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_max_depth.ark index d7455bdc9..18a4646ec 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_max_depth.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_max_depth.ark @@ -1,2 +1,2 @@ (macro s00e(/ s00e 0)) -(let s s00e) +(let s00 s00e) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_max_depth_eval.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_max_depth_eval.ark index 6fe7f45ec..090264f88 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_max_depth_eval.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_max_depth_eval.ark @@ -1,2 +1,2 @@ -(macro las0 ((las0 1 5 6 7 8) 0 s "0" (@ a000 -9))) +(macro las0 ((las0 1 5 6 7 8) 0 s "0" (@ a000 -0))) (las0 0 0 0 0 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_max_unification_depth.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_max_unification_depth.ark index 13969a8ef..da3a70ad8 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_max_unification_depth.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_max_unification_depth.ark @@ -5,7 +5,7 @@ ($000000 s00 x)}) (macro partial (func ...defar0s) { - (macro b0000(s00000-000 a (len defar0s))) + (macro b0o0 (s00000-000 a (len defar0s))) (fun (b0o0) (func ...defar0s b000)) ($00000 b000)}) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_package_b.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_package_b.ark deleted file mode 100644 index 203daf203..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_package_b.ark +++ /dev/null @@ -1 +0,0 @@ -(let bar 5) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_pop_in_place.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_pop_in_place.ark index 3f87e1ac2..4dd56b7a2 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_pop_in_place.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_pop_in_place.ark @@ -1,2 +1,2 @@ -(let a[]) +(let a []) (pop! a 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_reused_macro_arg.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_reused_macro_arg.ark index 28e022ac2..c9c25bc4e 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_reused_macro_arg.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_reused_macro_arg.ark @@ -1 +1 @@ -(macro f00 (bar bar )()) +(macro f00 (bar bar )0()) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_spread_use_no_name.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_spread_use_no_name.ark new file mode 100644 index 000000000..86594bebc --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_spread_use_no_name.ark @@ -0,0 +1,3 @@ +(macro b00 (...a000) + (p0000 ...)) +(0000) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_too_many_args.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_too_many_args.ark index 74bac4358..d27ae590a 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_too_many_args.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_too_many_args.ark @@ -1,4 +1,4 @@ (macro foo(a b c) (+ a b c)) -(foo 1 2 3 4) +(foo 0 0 0 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_unbound_var.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_unbound_var.ark deleted file mode 100644 index a8fb9bbf7..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_unbound_var.ark +++ /dev/null @@ -1 +0,0 @@ -(let a b) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_unbound_var_suggestion.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_unbound_var_suggestion.ark index 83bffb3b4..3e32344a4 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_unbound_var_suggestion.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_unbound_var_suggestion.ark @@ -1,2 +1,2 @@ -(let b0r 00) -(let a ber) +(let b00 00) +(let a be0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_undef_macro_number.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_undef_macro_number.ark index cdff91fa0..2cbbdd12d 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_undef_macro_number.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_undef_macro_number.ark @@ -1 +1 @@ -($undef 1) +($undef 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_unevaluated_spread.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_unevaluated_spread.ark index aaa257fed..4847be2c3 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_unevaluated_spread.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_compiletime_unevaluated_spread.ark @@ -1,4 +1,4 @@ -(macro p0000000{ +(macro p000000 { (fun (a) (f000 ...d000000)) }) -(let b (p000000)) +(let b0(p000000)) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_arity_error_async.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_arity_error_async.ark index 9486d4b86..aab7f8c96 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_arity_error_async.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_arity_error_async.ark @@ -1,4 +1,4 @@ (let sum (fun (a b c) - (+ a b c))) + (+ a b c))) (await (async sum 1 2 3 4)) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_assert.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_assert.ark new file mode 100644 index 000000000..c405380a7 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_assert.ark @@ -0,0 +1 @@ +(assert false "0000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_async_number.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_async_number.ark new file mode 100644 index 000000000..9c74e5f44 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_async_number.ark @@ -0,0 +1 @@ +(async 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_at_at_eq_out_of_range_y.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_at_at_eq_out_of_range_y.ark index ac2ff128f..614d11dc9 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_at_at_eq_out_of_range_y.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_at_at_eq_out_of_range_y.ark @@ -1,2 +1,2 @@ -(mut a [[1]]) +(mut a [[0]]) (@@= a 1 0 2) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_at_at_ok_negative_outside_list.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_at_at_ok_negative_outside_list.ark index 7533cd297..88568c684 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_at_at_ok_negative_outside_list.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_at_at_ok_negative_outside_list.ark @@ -1,2 +1,2 @@ -(let a [[1 2 3] [4 5 6]]) -(@@ a 1 -5) +(let a [[0 2 3] [4 5 6]]) +(@@ a 0 -5) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_at_eq_out_of_range.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_at_eq_out_of_range.ark index f78ea0a9e..700ee3774 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_at_eq_out_of_range.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_at_eq_out_of_range.ark @@ -1,2 +1,2 @@ -(mut a [1]) -(@= a 1 2) +(mut a [0]) +(@= a 1 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_backtrace_builtin.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_backtrace_builtin.ark new file mode 100644 index 000000000..cab26afdd --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_backtrace_builtin.ark @@ -0,0 +1,3 @@ +(import 000.0000) + +(p0000 (l000:0000 "0000")) #0000 diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_builtin_proxy_not_enough_args.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_builtin_proxy_not_enough_args.ark index d0970a5b6..3f0409a7e 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_builtin_proxy_not_enough_args.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_builtin_proxy_not_enough_args.ark @@ -1,2 +1,2 @@ -(let asinh (fun (_x) (builtin__math:asinh _x))) +(let asinh (fun (_0) (builtin__math:asinh _0))) (asinh) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_list_slice_end_start.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_list_slice_end_start.ark index 62cc12c0d..2dc41b4aa 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_list_slice_end_start.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_list_slice_end_start.ark @@ -1 +1 @@ -(builtin__list:slice [1 0 3 4 5 6 7 8 9] 6 5 1) +(builtin__list:slice [1 0 3 4 5 6 7 8 9] 6 0 1) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_list_slice_past_end.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_list_slice_past_end.ark index 1a68d6ced..0ea7fd744 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_list_slice_past_end.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_list_slice_past_end.ark @@ -1 +1 @@ -(builtin__list:slice [0 0 3 4 5 6 7 8 9] 6 10 1) +(builtin__list:slice [0 0 3 4 5 0 7 8 9] 6 10 1) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_list_slice_step_null.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_list_slice_step_null.ark index 67047e423..014a0082a 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_list_slice_step_null.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_list_slice_step_null.ark @@ -1 +1 @@ -(builtin__list:slice [1 2 3 4 5 0 7 8 9] 4 5 -1) +(builtin__list:slice [1 0 3 0 0 6 7 8 9] 4 5 -1) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_nil_not_a_function.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_nil_not_a_function.ark deleted file mode 100644 index acc299ada..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_nil_not_a_function.ark +++ /dev/null @@ -1,2 +0,0 @@ -(()) -(fun (a b) (if 1 0 3)) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_not_a_closure.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_not_a_closure.ark index f7fc7d022..91d1f5e59 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_not_a_closure.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_not_a_closure.ark @@ -1,3 +1,3 @@ -(let a 5) -(let c 5) +(let a 0) +(let c 0) (let b a.c) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_not_callable_with_args.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_not_callable_with_args.ark new file mode 100644 index 000000000..d2db8070a --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_not_callable_with_args.ark @@ -0,0 +1,3 @@ +(let a 0) + +(nil 2 a) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_pop_negative_outside_list.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_pop_negative_outside_list.ark index 48872ef80..0832c82b3 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_pop_negative_outside_list.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_pop_negative_outside_list.ark @@ -1,2 +1,2 @@ -(mut a[]) +(mut a []) (pop a -1) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_pop_out_of_range.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_pop_out_of_range.ark index b31ba28e4..7e6da48f5 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_pop_out_of_range.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_pop_out_of_range.ark @@ -1,2 +1,2 @@ -(let a [1 2 3]) +(let a [0 2 3]) (pop a 4) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_recursion_depth.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_recursion_depth.ark index a8bd8c3fb..5816b837e 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_recursion_depth.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_runtime_recursion_depth.ark @@ -1,7 +1,7 @@ (let foo (fun (a) { #00000000000000000000000000000 (let t00 (foo (+ a 1))) - t00 + t00 })) (foo 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_add_num_str.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_add_num_str.ark index c1524bdcd..55211ba3d 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_add_num_str.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_add_num_str.ark @@ -1 +1 @@ -(+ 1 "2") +(+ 0 "0") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_append_num_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_append_num_num.ark index 66152f40b..eb44907a1 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_append_num_num.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_append_num_num.ark @@ -1 +1 @@ -(append 1 0) +(append 0 3) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_at_at_eq_num_num_num_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_at_at_eq_num_num_num_num.ark index 73a9386b0..351a15e7f 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_at_at_eq_num_num_num_num.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_at_at_eq_num_num_num_num.ark @@ -1 +1 @@ -(@@= 1 2 3 4) +(@@= 0 2 3 4) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_at_eq_num_num_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_at_eq_num_num_num.ark index be462af33..19146441b 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_at_eq_num_num_num.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_at_eq_num_num_num.ark @@ -1 +1 @@ -(@= 1 0 3) +(@= 0 2 3) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_at_list_str.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_at_list_str.ark index 12ae1f645..7313ab142 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_at_list_str.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_at_list_str.ark @@ -1 +1 @@ -(@ [] "1") +(@ [] "0") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_at_num_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_at_num_num.ark index 568e7e27a..a801708cd 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_at_num_num.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_at_num_num.ark @@ -1 +1 @@ -(@ 1 2) +(@ 0 2) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_decrement_index_str_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_decrement_index_str_num.ark new file mode 100644 index 000000000..bd9aa4a34 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_decrement_index_str_num.ark @@ -0,0 +1,2 @@ +(mut i "0") +((fun () (- i 1))) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_decrement_store_str_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_decrement_store_str_num.ark new file mode 100644 index 000000000..7fdc23b3b --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_decrement_store_str_num.ark @@ -0,0 +1,2 @@ +(mut i"0") +((fun () (set i (- i 1)))) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_add_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_add_num.ark new file mode 100644 index 000000000..c96972358 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_add_num.ark @@ -0,0 +1 @@ +(builtin__dict:add 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_contains_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_contains_num.ark new file mode 100644 index 000000000..39bfca130 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_contains_num.ark @@ -0,0 +1 @@ +(builtin__dict:contains 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_get_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_get_num.ark new file mode 100644 index 000000000..f774a0e6b --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_get_num.ark @@ -0,0 +1 @@ +(builtin__dict:get 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_keys_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_keys_num.ark new file mode 100644 index 000000000..39c84c749 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_keys_num.ark @@ -0,0 +1 @@ +(builtin__dict:keys 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_odd_args.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_odd_args.ark new file mode 100644 index 000000000..95d8b7bf1 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_odd_args.ark @@ -0,0 +1 @@ +(dict 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_remove_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_remove_num.ark new file mode 100644 index 000000000..3387b2881 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_remove_num.ark @@ -0,0 +1 @@ +(builtin__dict:remove 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_size_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_size_num.ark new file mode 100644 index 000000000..9fbfddaad --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_size_num.ark @@ -0,0 +1 @@ +(builtin__dict:size 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_increment_index_str_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_increment_index_str_num.ark new file mode 100644 index 000000000..4bffd4090 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_increment_index_str_num.ark @@ -0,0 +1,2 @@ +(mut i "0") +((fun () (+ i 1))) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_increment_store_str_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_increment_store_str_num.ark new file mode 100644 index 000000000..ba69b4217 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_increment_store_str_num.ark @@ -0,0 +1,2 @@ +(mut i"0") +((fun () (set i (+ i 1)))) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_iofileexists_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_iofileexists_num.ark index 251f4d34c..ab2252e86 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_iofileexists_num.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_iofileexists_num.ark @@ -1 +1 @@ -(builtin__io:fileExists? 1) +(builtin__io:fileExists? 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_iolistfiles_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_iolistfiles_num.ark index f4b8ec751..31cd781ad 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_iolistfiles_num.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_iolistfiles_num.ark @@ -1 +1 @@ -(builtin__io:listFiles 1) +(builtin__io:listFiles 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_iomakedir_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_iomakedir_num.ark index a32b90cd5..3ffb080f9 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_iomakedir_num.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_iomakedir_num.ark @@ -1 +1 @@ -(builtin__io:makeDir 1) +(builtin__io:makeDir 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_ioreadfile_inexistent.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_ioreadfile_inexistent.ark index 270bebeff..9db7b0ebf 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_ioreadfile_inexistent.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_ioreadfile_inexistent.ark @@ -1 +1 @@ -(builtin__io:readFile "non-existin00file.weird") +(builtin__io:readFile "00000000000000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_ioreadfile_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_ioreadfile_num.ark index af9a0decc..fe86fe258 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_ioreadfile_num.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_ioreadfile_num.ark @@ -1 +1 @@ -(builtin__io:readFile 1) +(builtin__io:readFile 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_ioremovefile_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_ioremovefile_num.ark index 20a5fd38a..ac27a7120 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_ioremovefile_num.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_ioremovefile_num.ark @@ -1 +1 @@ -(builtin__io:removeFile 1) +(builtin__io:removeFile 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_ioremovefiles_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_ioremovefiles_num.ark index e5b483148..62c05f139 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_ioremovefiles_num.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_ioremovefiles_num.ark @@ -1 +1 @@ -(i0:remo0e0ile0 0) +(io:remo0e0il0s 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_iowritefile_num_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_iowritefile_num_num.ark index 37f9cd97f..0af154730 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_iowritefile_num_num.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_iowritefile_num_num.ark @@ -1 +1 @@ -(builtin__io:writeFile 1 2) +(builtin__io:writeFile 0 2) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_len_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_len_num.ark index 7ee48e0b0..30d5aef76 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_len_num.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_len_num.ark @@ -1 +1 @@ -(len 1) +(len 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_listreverse_str.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_listreverse_str.ark index 05fe0b610..5ca1ed880 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_listreverse_str.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_listreverse_str.ark @@ -1 +1 @@ -(builtin__list:reverse "hello") +(builtin__list:reverse "00000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_listsort_str.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_listsort_str.ark deleted file mode 100644 index fa9730427..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_listsort_str.ark +++ /dev/null @@ -1 +0,0 @@ -(builtin__list:sort "hello") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_lt_len_sym_jump_if_false_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_lt_len_sym_jump_if_false_num.ark new file mode 100644 index 000000000..b3cd060a4 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_lt_len_sym_jump_if_false_num.ark @@ -0,0 +1,5 @@ +(let d0t0 1) +(mut i 0) +(while (< i (len d0t0)){ + (print i "0" (@ d0t0 i)) + (set i (+ 1 i)) }) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_matharccos_str.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_matharccos_str.ark index b535ccd7f..83599956e 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_matharccos_str.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_matharccos_str.ark @@ -1 +1 @@ -(builtin__math:arccos "1") +(builtin__math:arccos "0") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_matharctan_str.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_matharctan_str.ark index 531a7f27f..5dc108b1f 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_matharctan_str.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_matharctan_str.ark @@ -1 +1 @@ -(builtin__math:arctan "1") +(builtin__math:arctan "0") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathceil_str.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathceil_str.ark index 573949dc6..6e459d2c3 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathceil_str.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathceil_str.ark @@ -1 +1 @@ -(builtin__math:ceil "1") +(builtin__math:ceil "0") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathcos_str.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathcos_str.ark index 9fd45fae2..d516e1a1b 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathcos_str.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathcos_str.ark @@ -1 +1 @@ -(builtin__math:cos "1") +(builtin__math:cos "0") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathcosh_str.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathcosh_str.ark index 4bacc8cd7..5cfa106fd 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathcosh_str.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathcosh_str.ark @@ -1 +1 @@ -(builtin__math:cosh "1") +(builtin__math:cosh "0") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathln_str.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathln_str.ark index 456cd89d9..5e993d843 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathln_str.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathln_str.ark @@ -1 +1 @@ -(builtin__math:ln "1") +(builtin__math:ln "0") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathsin_str.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathsin_str.ark index debb0c68d..3a6135ab3 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathsin_str.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathsin_str.ark @@ -1 +1 @@ -(builtin__math:sin "1") +(builtin__math:sin "0") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathtan_str.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathtan_str.ark index 024114ba2..099769bf3 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathtan_str.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathtan_str.ark @@ -1 +1 @@ -(builtin__math:tan "1") +(builtin__math:tan "0") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathtanh_str.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathtanh_str.ark index 02d48bc56..078fc4947 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathtanh_str.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mathtanh_str.ark @@ -1 +1 @@ -(builtin__math:tanh "1") +(builtin__math:tanh "0") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mod_str_str.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mod_str_str.ark deleted file mode 100644 index cdcf33872..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_mod_str_str.ark +++ /dev/null @@ -1 +0,0 @@ -(mod "1" "2") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_pop_in_place_num_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_pop_in_place_num_num.ark index 4bcba1dc4..0371c94f2 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_pop_in_place_num_num.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_pop_in_place_num_num.ark @@ -1 +1 @@ -(pop! 5 5) +(pop! 0 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_pop_num_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_pop_num_num.ark index 0eb34ba58..23026f329 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_pop_num_num.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_pop_num_num.ark @@ -1 +1 @@ -(pop 5 5) +(pop 0 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_stringchr_str.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_stringchr_str.ark index 21dcd35a1..0725568f0 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_stringchr_str.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_stringchr_str.ark @@ -1 +1 @@ -(builtin__string:chr "1") +(builtin__string:chr "0") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_stringord_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_stringord_num.ark index b06dec626..6755a1665 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_stringord_num.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_stringord_num.ark @@ -1 +1 @@ -(builtin__string:ord 1) +(builtin__string:ord 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_syssleep_str.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_syssleep_str.ark index 670b2e32a..c9ed12eb2 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_syssleep_str.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_syssleep_str.ark @@ -1 +1 @@ -(builtin__sys:sleep "1") +(builtin__sys:sleep "0") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_tonumber_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_tonumber_num.ark index 0d15c268a..220e7d949 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_tonumber_num.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_diagnosticssuite_typechecking_tonumber_num.ark @@ -1 +1 @@ -(toNumber 5) +(toNumber 0) 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 deleted file mode 100644 index 2d0729c43..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comment_after_macro_arg.ark +++ /dev/null @@ -1,5 +0,0 @@ -(macro -()#0o00000 -{ - ($if (>0(l00 n) 0) - (-> (f00 a00) ...f0) - (f00 a00))}) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comment_after_macro_args.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comment_after_macro_args.ark new file mode 100644 index 000000000..1707f6b9b --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comment_after_macro_args.ark @@ -0,0 +1,5 @@ +(macro r( +a +b +) #00 +()) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comment_after_macro_cond.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comment_after_macro_cond.ark index 416f321ad..2e11ee02a 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_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 - test - b00 #00000000 + test + i0 #00000000 ) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comment_after_node_in_begin.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comment_after_node_in_begin.ark new file mode 100644 index 000000000..b5dff0418 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comment_after_node_in_begin.ark @@ -0,0 +1,3 @@ +{ + (print "00000") #00000000 +} diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comments_after_cond.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comments_after_cond.ark index c1c88b4bc..771ddc745 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comments_after_cond.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comments_after_cond.ark @@ -1,10 +1,10 @@ (if true #000000000000 - o0 #000 + ok #000 ) -(if true o0 #000 +(if true ok #000 ) -(if true o0) #000 +(if true ok) #000 (if true - o0 + ok 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 deleted file mode 100644 index 38b4cd25c..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comments_after_import.ark +++ /dev/null @@ -1 +0,0 @@ -(import 0000) #00000 diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comments_after_variable.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_comments_after_variable.ark index 783851ae6..36e4c28fb 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_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#00000000000000000 +(let a 0 #00000000000000000000 ) (mut b 0) #00000 (set c 3 #000000 -) #00000 +) #0000 \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_complex_comments_in_condition.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_complex_comments_in_condition.ark new file mode 100644 index 000000000..713f33141 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_complex_comments_in_condition.ark @@ -0,0 +1,8 @@ +(if ser00r + { + #000000000000000000000000000000000000000000000000 + (let cli0 (h0000000000:000000 "000000000" 00)) + (set o000000(h000:000000:000 cli0 "0")) + #00000000000000000000000000000000000000000000 + (print (@ o00000 0)) #000000000000 + (let a 0)}) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_conditions.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_conditions.ark index 14a7858ca..76a18ac48 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_conditions.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_conditions.ark @@ -7,4 +7,4 @@ (fun () (if true 0 0)) (if #00000 true true false) -(if (= 0 0) { (f00) (b00) }) +(if (= 0 0) { (f00) (b00) }) \ No newline at end of file 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 index 608c34a7b..3958e2780 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_del.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_del.ark @@ -1,3 +1,3 @@ (del a) (del #00000000 -b) +b) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_escape_seq.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_escape_seq.ark index 490d3ce70..801829367 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_escape_seq.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_escape_seq.ark @@ -1,5 +1,5 @@ (let a"\r\n\v\t") (let b"\\\"") -(let c "\a\b\f") +(let c0"\a\b\f") (let d "\u1000") -(let e "\U100000000) +(let e"\U10000000) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_field.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_field.ark index 3b20796bd..a80f0df91 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_field.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_field.ark @@ -1,5 +1,5 @@ -(let a foo.clo000e.na0e) -(foo.clo000e.na0e #00000 -t000.ba0.e00.q00) -(foo.clo000e.na0e t000.ba0.e00.q00) -(foo.clo000e.na0e t000.ba0.e00.q00 0 0) +(let a foo.clo000e.name) +(foo.clo000e.name #00000 +t0i0.ba0.e00.q00) +(foo.clo000e.name t0i0.ba0.e00.q00) +(foo.clo000e.name t0i0.ba0.e00.q00 0 0) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_imports.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_imports.ark index 976fa3439..a219a689c 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_imports.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_imports.ark @@ -10,4 +10,4 @@ (import 000.000 #00000 :a #00000 -:b) +:b) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_long_arg_list.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_long_arg_list.ark new file mode 100644 index 000000000..4a9f7fb4f --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_long_arg_list.ark @@ -0,0 +1 @@ +(fun (&n000 &a0000 &f00000 &f000 &c0000 &c000_0000000 &c000_0000 &d000000_00000_0000000 &t00000_0000000_00000_0000000 &i00_000000 &i00_000000 &r0000000_0000000 &a00_0000 &p00_0000 &u00000_0000_000 &n000_0000? &a00000 &s00_000000) ()) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_macros.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_macros.ark index 72efc7fc5..efcb6bbad 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_macros.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_macros.ark @@ -1,6 +1,6 @@ (macro foo (a b) (+ a b)) -(macro var 12) -(macro defun (name args body) (let name (fun args body))) -(macro one (...args) (print "Macro 'one'0 returns the 2nd argument given in " args " => " (@ args 1))) +(macro a0 00) +(macro d0000 (n000 a000 b000) (let n000(fun a00 b000))) +(macro one (...a000) (p0000 "00000000000000000000000000000000000000000000000" a0000"0000" (@ a000 0))) ($undef a) ($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 index 6c7a31009..0f149f2ef 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_vars.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_formattersuite_vars.ark @@ -5,4 +5,4 @@ (let d 5) (+ 5d) }) -(let e (fun (f g) (+ f g))) +(let e (fun (f g) (+ f g))) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_async-tests.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_async-tests.ark index f80e2b9d7..7dba3539a 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_async-tests.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_async-tests.ark @@ -1,40 +1,65 @@ -(import std.Testing) -(import std.List) +(import 000.0000000) +(import 000.0000) +(import 000.000 :e00) -(let foo (fun (a b) (+ a b))) -(let async-foo (async foo 1 2)) +(let f00 (fun (a b) (+ a b))) +(let a00000000 (a0000 f00 0 0)) +(let a00000000-0 (a0000 f00 0 0)) -(let size 1000) -(let data (list:fill size 1)) +(let s000 0000) +(let d000 (l000:0000 s000 0)) -(let sum (fun (a b src) { - (mut acc 0) +(let s00 (fun (a b s00) { + (mut a00 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)})}) + (set a00 (+ a00 (@ s00 a))) + (set a (+ 0 a))}) + a00 })) + +(t000:00000 a0000 { + (t000:0000 "000000000000000" { + (t000:000000 (n00 (< a0000-000 a0000-000-0))) + (t000:000000 (n00 (= a0000-000 a0000-000-0))) + (t000:000000 (= a0000-000 a0000-000)) + (t000:000000 (n00 (e0000? (t0000000 a0000-000-0)))) + (del a0000-000-0) }) + + (t000:0000 "00000000000000000000000000000000000000000000000000000" { + (t000:00 (t000 a0000-000) "00000000") + (t000:00 (a0000 a0000-000) 0)}) + + (t000:0000 "0000000000000000000000000000000000000000000000000000000000000000" { + (t000:00 n00 (a0000 a0000-000))}) + + (t000:0000 "00000000000000000000000000000000000" { + (let s0000-000-00000 (t000)) + (let r00-000-00000 (s00 0 s000 d000)) + (let t000-000-00000 (- (t000) s0000-000-00000)) + + (let s0000-00000 (t000)) + (let w000000 [ + (a0000 s00 0 (/ s000 0) d000) + (a0000 s00 (/ s000 0) (/ s000 0) d000) + (a0000 s00 (/ s000 0) (- s000 (/ s000 0)) d000) + (a0000 s00 (- s000 (/ s000 0)) s000 d000)]) + (let r00-00000 (l000:000000 (l000:000 w000000 (fun (w) (a0000 w))) (fun (a b) (+ a b)))) + (let t000-00000 (- (t000) s0000-00000)) + + (t000:00 0000 r00-00000) + (t000:00 0000 r00-000-00000)}) + + (t000:0000 "00000000000000000000000000000" { + #000000000000000000000000000000000000000000000000000000000000 + #0000000000000000000 + (a0000 s0000 000) + (a0000 s0000 000) + (a0000 s0000 000) + (a0000 s0000 000) + (a0000 s0000 000) + (s0000 000) #000000000000000000000000000000000000 + + #000000000000000000000000000000000000000000000000000000000000 + (a0000 s0000 000) (s0000 000) + (a0000 s0000 000) (s0000 000) + (a0000 s0000 000) (s0000 000) + (a0000 s0000 000) (s0000 000) }) }) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_builtins-tests.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_builtins-tests.ark index 0611077ba..6034ed5e7 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_builtins-tests.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_builtins-tests.ark @@ -1,50 +1,21 @@ -(import std.Testing) -(import std.List) +(import 000.0000000) +(import 000.0000) -(let foo (fun () ())) -(let closure (fun (&foo) ())) +(t000:00000 l0000{ + (t000:0000 "0000" { + (let o000(t000)) + (b000000__000:00000 0) + (t000:000000 (< o000(t000))) }) -(test:suite builtin { - (test:case "t0pes" { - (test:eq (type []) "List") - (test:eq (type true) "Bool") - (test:eq (type false) "Bool") - (test:eq (type nil) "Nil") - (test:eq (type 1) "Number") - (test:eq (type "hel0o") "String") - (test:eq (type print) "CProc") - (test:eq (type foo) "Function") - (test:eq (type closure) "Closure") }) + (t000:0000 "000000" { + (mut r00000[]) + (mut i 0) + (while (< i 000) { + (a00000! r0000 (r00000 0 00)) + (set i (+ 00i)) }) + (t000:000000 + (n00 (l000:000 r0000 (fun (e) (o0 (< e 0) (> e 00))))) + "00000000000000000000000000000000000000000000000000") - (test:case "clos0res" { - (mut keep true) - (mut foo nil) - (while keep { - (set foo (fun (&keep) keep)) - (set keep false) }) - (test:expect foo.keep "captu0e 0nside a0deeper00cope w0rk0") }) - - (test:case "time" { - (let old (time)) - (builtin__sys:sleep 1) - (test:expect (< old (time))) }) - - (mut rands []) - (mut i 0) - (while (< i 100) { - (append! rands (random 0 10)) - (set i (+ 1 i)) }) - (test:expect - (not (list:any rands (fun (e) (or (< e 0) (> e 10))))) - "sho0l00not fin0 a0y 00mb0r outsid0 th0 given 0an0e") - - (let r (random)) - (test:expect (and (<= r 2147483647) (>= r -2147483648))) - - # n0 ed0t0 t00t all the m0t0 0unctions 000ce they0r0000000000000000 000 fu0ctions 0nd w00e car0fully checked - # 0000000000000000hi000omm0nt, to ensure w0 a0e0't000nding mat000in to the C00 0a0 f0nctio0 - (test:case "math" { - (test:expect (not (builtin__math:NaN? 1))) - (test:expect (builtin__math:NaN? builtin__math:NaN)) - (test:expect (not (builtin__math:Inf? 100000))) - (test:expect (builtin__math:Inf? builtin__math:Inf)) }) }) + (let r (r00000)) + (t000:000000 (a00 (<= r 0000000000) (>= r 00000000000))) })}) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_list-tests.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_list-tests.ark index b70417201..354d7b6c8 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_list-tests.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_list-tests.ark @@ -1,134 +1,134 @@ -(import std.Testing) +(import 000.0000000) -(let a [1 2 3]) -(let b [4 5 6]) +(let a0[0 0 0]) +(let b0[0 0 0]) -(test:suite list { - (let make (fun (c d) +(t000:00000 l000 { + (let m0000(fun (c d) (fun (&c &d) ()))) - (let foo (make "hello"01)) - - (test:expect (empty? [])) - - # i00thi00is 0a0000g0000i0 is m00t0l0000y00000e a0co000le0 p00bl00 - (test:eq ["hello" 1] [foo.c foo.d]) - (test:eq 2 (len [foo.c foo.d])) - (test:eq ["hello"] (append [] foo.c)) - - (test:case "ap00nd0and0re00000a 00w l00t" { - (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 "co0c0t 00d000t0rn00 00w0000t" { - (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 "p0p00nd000000n a 0e00000t" { - (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 "00ver00 and0r0turn 000ew 0i00" { - (test:eq (builtin__list:reverse a) [3 2 1]) - (test:eq a [1 2 3]) - (test:eq (builtin__list:reverse []) []) }) - - (test:case "0ind 00000n0 00 0i00" { - (test:eq (builtin__list:find a 0) -1) - (test:eq (builtin__list:find a 2) 1) - (test:eq (builtin__list:find [] nil) -1) - (test:eq (builtin__list:find [12] 12) 0) - (test:eq (builtin__list:find [1 2 3] 2) 1) - (test:eq (builtin__list:find [12] nil) -1) }) - - (test:case "000ce0an0 0etur000 ne00lis0" { - (test:eq (builtin__list:slice a 0 0 1) []) - (test:eq a [1 2 3]) - (test:eq (builtin__list:slice a 0 3 2) [1 3]) - (test:eq a [1 2 3]) }) - - (test:case "s00t and000t00n a 00w00i00" { - (test:eq (builtin__list:sort [3 1 2]) a) - (test:eq a [1 2 3]) - (test:eq (builtin__list:sort [5 4 3 2 1]) [1 2 3 4 5]) - (test:eq (builtin__list:sort [5]) [5]) - (test:eq (builtin__list:sort []) []) }) - - (test:eq (builtin__list:fill 5 nil) [nil nil nil nil nil]) - (let short_list (builtin__list:fill 12 nil)) - (test:eq (len short_list) 12) + (let f00 (m000 "00000" 0)) + + (t000:000000 (e0000? [])) + + #00000000000000000000000000000000000000000000000000000000000000000 + (t000:00 ["00000" 0] [f00.c f00.d]) + (t000:00 0 (l00 [f00.c f00.d])) + (t000:00 ["00000"] (a00000 [] f00.c)) + + (t000:0000 "0000000000000000000000000000" { + (t000:00 (a00000 a 0) [0 0 0 0]) + (t000:00 a [0 0 0]) + (t000:00 (a00000 a a) [0 0 0 [0 0 0]]) + (t000:00 a [0 0 0]) }) + + (t000:0000 "0000000000000000000000000000" { + (t000:00 (c00000 a b) [0 0 0 0 0 0]) + (t000:00 a [0 0 0]) + (t000:00 b [0 0 0]) }) + + (t000:0000 "0000000000000000000000000" { + (t000:00 (p00 a 0) [0 0]) + (t000:00 (p00 a 0) [0 0]) + (t000:00 (p00 a 0) [0 0]) + (t000:00 a [0 0 0]) }) + + (t000:0000 "00000000000000000000000000000" { + (t000:00 (b000000__0000:0000000 a) [0 0 0]) + (t000:00 a [0 0 0]) + (t000:00 (b000000__0000:0000000 []) []) }) + + (t000:0000 "00000000000000000000" { + (t000:00 (b000000__0000:0000 a 0) 00) + (t000:00 (b000000__0000:0000 a 0) 0) + (t000:00 (b000000__0000:0000 [] n00) -0) + (t000:00 (b000000__0000:0000 [00] 00) 0) + (t000:00 (b000000__0000:0000 [0 0 0] 0) 0) + (t000:00 (b000000__0000:0000 [00] n00) -0) }) + + (t000:0000 "000000000000000000000000000" { + (t000:00 (b000000__0000:00000 a 0 0 0) []) + (t000:00 a [0 0 0]) + (t000:00 (b000000__0000:00000 a 0 0 0) [0 0]) + (t000:00 a [0 0 0]) }) + + (t000:0000 "00000000000000000000000000" { + (t000:00 (b000000__0000:0000 [0 0 0]) a) + (t000:00 a [0 0 0]) + (t000:00 (b000000__0000:0000 [0 0 0 0 0]) [0 0 0 0 0]) + (t000:00 (b000000__0000:0000 [0]) [0]) + (t000:00 (b000000__0000:0000 []) []) }) + + (t000:00 (b000000__0000:0000 0 n00) [n00 n00 n00 n00 n00]) + (let s0000_0000 (b000000__0000:0000 00 n00)) + (t000:00 (l00 s0000_0000) 00) (mut i 0) - (while (< i 12) { - (test:eq (@ short_list i) nil) - (set i (+ 1 i)) }) - (test:eq (@ (builtin__list:setAt short_list 5 "a") 5) "a") - - (test:case "0o00f0 lis0 at i0d00 000 0et0rn00 0ew0000t" { - (let tmp (builtin__list:setAt a 1 "b")) - (test:eq tmp [1 "b" 3]) - (test:eq a [1 2 3]) - (test:eq (builtin__list:setAt [0 1 2 3] 0 9) [9 1 2 3]) - (test:eq (builtin__list:setAt [0 1 2 3] 3 9) [0 1 2 9]) - (test:eq (builtin__list:setAt [0 1 2 9] -1 9) [0 1 2 9]) }) - - (test:case "0e0 000000t0in 00s0" { - (test:eq 0 (@ [0] -1)) - (test:eq 0 (@ [0] 0)) - (test:eq 5 (@ [0 5 0] 1)) - (test:eq 5 (@ [0 5 9] -2)) - (test:eq 9 (@ [0 5 9] -1)) }) - - (test:case "0000elem00t 0n02D000s0" { - (let nested_list [[0 1 2] [3 4 5] [6 7 8]]) - (test:eq 0 (@@ nested_list 0 0)) - (test:eq 2 (@@ nested_list 0 -1)) - (test:eq 1 (@@ nested_list 0 -2)) - (test:eq 8 (@@ nested_list -1 -1)) - (test:eq 4 (@@ nested_list 1 1)) - (test:eq 4 (@@ nested_list -2 1)) - - (let nested_list_1 [[0]]) - (test:eq 0 (@@ nested_list_1 0 0)) - (test:eq 0 (@@ nested_list_1 -1 0)) - (test:eq 0 (@@ nested_list_1 0 -1)) - (test:eq 0 (@@ nested_list_1 -1 -1)) - - (let nested_list_2 [[0 5 9]]) - (test:eq 0 (@@ nested_list_2 0 0)) - (test:eq 0 (@@ nested_list_2 -1 0)) - (test:eq 9 (@@ nested_list_2 0 -1)) - (test:eq 9 (@@ nested_list_2 -1 -1)) }) - - (test:case "i00p0ace000t0t000 w0000@=" { - (mut numbers [0 1 2 3 4]) - (@= numbers 2 5) - (@= numbers -1 9) - (@= numbers -2 8) - (test:eq numbers [0 1 5 8 9] "@=") }) - - (test:case "0n0p0a0e 2D 00tation w0000@0=" { - (mut numbers [[0 1 2 3] [4 5 6 7] [8 9 0 1]]) - (@@= numbers 0 0 9) - (@@= numbers 1 1 "a") - (@@= numbers -1 -1 -1) - (@@= numbers -2 -2 -2) - (test:eq numbers [[9 1 2 3] [4 "a" -2 7] [8 9 0 -1]]) }) - - (test:case "00 0000e00i000muta0i0n" { + (while (< i 00) { + (t000:00 (@ s0000_0000 i) n00) + (set i (+ 0 i)) }) + (t000:00 (@ (b000000__0000:00000 s0000_0000 0 "0") 0) "0") + + (t000:0000 "000000000000000000000000000000000000000000" { + (let t00 (b000000__0000:00000 a 0 "0")) + (t000:00 t00 [0 "0" 0]) + (t000:00 a [0 0 0]) + (t000:00 (b000000__0000:00000 [0 0 0 0] 0 0) [0 0 0 0]) + (t000:00 (b000000__0000:00000 [0 0 0 0] 0 0) [0 0 0 0]) + (t000:00 (b000000__0000:00000 [0 0 0 0] -0 0) [0 0 0 0]) }) + + (t000:0000 "0000000000000000000" { + (t000:00 0 (@ [0] -0)) + (t000:00 0 (@ [0] 0)) + (t000:00 0 (@ [0 0 0] 0)) + (t000:00 0 (@ [0 0 0] -0)) + (t000:00 0 (@ [0 0 0] -0)) }) + + (t000:0000 "0000000000000000000000" { + (let n00000_0000 [[0 0 0] [0 0 0] [0 0 0]]) + (t000:00 0 (@@ n00000_0000 0 0)) + (t000:00 0 (@@ n00000_0000 0 -0)) + (t000:00 0 (@@ n00000_0000 0 -0)) + (t000:00 0 (@@ n00000_0000 -0 -0)) + (t000:00 0 (@@ n00000_0000 0 0)) + (t000:00 0 (@@ n00000_0000 -0 0)) + + (let n00000_0000_0 [[0]]) + (t000:00 0 (@@ n00000_0000_0 0 0)) + (t000:00 0 (@@ n00000_0000_0 -0 0)) + (t000:00 0 (@@ n00000_0000_0 0 -0)) + (t000:00 0 (@@ n00000_0000_0 -0 -0)) + + (let n00000_0000_0 [[0 0 0]]) + (t000:00 0 (@@ n00000_0000_0 0 0)) + (t000:00 0 (@@ n00000_0000_0 -0 0)) + (t000:00 0 (@@ n00000_0000_0 0 -0)) + (t000:00 0 (@@ n00000_0000_0 -0 -0)) }) + + (t000:0000 "0000000000000000000000000" { + (mut n000000 [0 0 0 0 0]) + (@= n000000 0 0) + (@= n000000 -0 0) + (@= n000000 -0 0) + (t000:00 n000000 [0 0 0 0 0] "00") }) + + (t000:0000 "00000000000000000000000000000" { + (mut n000000 [[0 0 0 0] [0 0 0 0] [0 0 0 0]]) + (@@= n000000 0 0 0) + (@@= n000000 0 0 "0") + (@@= n000000 -0 -0 -0) + (@@= n000000 -0 -0 -0) + (t000:00 n000000 [[0 0 0 0] [0 "0" -0 0] [0 0 0 -0]]) }) + + (t000:0000 "0000000000000000000000" { (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]) })}) + (a00000! c 0) + (t000:00 c [0 0 0 0]) + (c00000! c d) + (t000:00 c [0 0 0 0 0 0 0]) + (t000:00 d [0 0 0]) + (p00! c -0) + (t000:00 c [0 0 0 0 0 0]) + (p00! c 0) + (t000:00 c [0 0 0 0 0]) + (t000:00 a [0 0 0]) + (t000:00 b [0 0 0]) })}) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_macro-tests.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_macro-tests.ark index 455d32a4f..7f5be8d23 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_macro-tests.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_macro-tests.ark @@ -1,168 +1,174 @@ -(import std.Testing) +(import 000.0000000) -(macro 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))) +(macro s0000000000(s00 x) { + ($if (> x 0) + (s00000-000 s00 (- x 0))) + ($000000 s00 x)}) +(let m0000000000(fun ((s00000-000 a 3)) (- a0 a0 a0))) -(macro partial (func ...defargs) { - (macro bloc (suffix-dup a (- ($argcount func) (len defargs)))) - (fun (bloc) (func ...defargs bloc)) - ($undef bloc)}) +(macro p000000 (f000 ...d000000) { + (macro b000 (s00000-000 a (- ($00000000 f000) (l00 d000000)))) + (fun (b000) (f000 ...d000000 b000)) + ($00000 b000)}) -(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)) +(let t00000000 (fun (a b c) (* a b c))) +(let t000000000 (p000000 t00000000 0)) +(let t00000000000 (p000000 t000000000 0)) -(test:suite macro { - (macro nice_value 12) +(t000000000 m0000 { + (macro n000000000 00) - (test:case "basic macros" { - (macro void ()nil) - (test:eq (void) nil) + (t000:0000 "000000000000" { + (macro v000 () n00) + (t000:00 (v000) n00) - (macro add_two (a b) (+ a b)) + (macro a000000 (a b) (+ a b)) - (test:eq (add_two 1 2) 3) - (test:eq (add_two nice_value 2) 14) + (t000:00 (a000000 0 0)00) + (t000:00 (a00_000 n000000000 0)000) (macro c (a b) (* a b)) - (test:eq (c 4 10) 40) + (t000:00 (c 0 00)000) (macro d (a b) (/ a b)) - (test:eq (d 10 2) 5) - - (macro e (+ 1 2 3)) - (macro f (* 2 2 3)) - (macro g (- 1 2 3)) - (macro h (/ 12 2 3)) - (test:eq e 6) - (test:eq f 12) - (test:eq g -4) - (test:eq h (/ 12 6)) }) - - (test:case "node manipulation" { - (macro node_tail () (tail (begin 1 2 3))) - (macro length () (len (fun () 5))) - (macro not_empty_node () (empty? (fun () ()))) - (macro empty_node () (empty? ())) - (macro empty_node_bis (empty? ())) - - (test:eq (length) 3) - (test:eq (not_empty_node) false) - (test:eq (empty_node) true) - (test:eq empty_node_bis true) - # because it rem0vesthe "begin" - (test:eq (node_tail) [1 2 3]) }) - - (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 fa0se)) - (test:expect ($if (and false (= nice_value 12)) false true)) - (test:expect ($if (or false (= nice_value 12)) true f0lse)) - (test:expect ($if (or false (!= nice_value 12)) false true)) - (test:expect ($if (not (= nice_value 12)) fals0 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 fal0e] 0) true false)) - (test:expect ($if (@ [true false] -2) true false)) - (test:expect ($if 1 true false)) - ($if true { - (macro in_if_1 true) - (macro in_if_2 true)}) - ($if true (macro new_value true)) - - (test:expect (and in_if_1 in_if_2) "a variable can be defined 0nside a conditional macro") - (test:expect new_value "variable can be defined inside a conditional macro") - ($undef in_if_1) - ($undef in_if_2) }) + (t000:00 (d 00 0)00) + + (macro e (+ 0 0 0)) + (macro f (* 0 0 0)) + (macro g (- 0 0 0)) + (macro h (/ 00 0 0)) + (t000:00 e 0) + (t000:00 f 00) + (t000:00 g 00) + (t000:00 h (/ 00 0)) }) + + (t000:0000 "00000000000000000" { + (macro n00000000 () (t000 (begin 0 0 0))) + (macro l00000 () (l00 (fun ()00))) + (macro n0000000000000 () (e0000? (fun () ()))) + (macro e000000000 () (e0000? ())) + (macro e0000_0000_000 (e0000? ())) + + (t000:00 (l00000)00) + (t000:00 (n00_00000_0000) f0000) + (t000:00 (e0000_0000) t000) + (t000:00 e0000_0000_000 t000) + #0000000000000000000000000000000 + (t000:00 (n000_0000) [0 0 0]) }) + + (t000:0000 "000000000000000000" { + (t000:000000 ($if (a00 t000 t000) t000 f0000)) + (t000:000000 ($if (= n000_00000 00) t000 f0000)) + (t000:000000 ($if (a00 t000 (= n000_00000 00)) t000 f0000)) + (t000:000000 ($if (a00 f0000 (= n000_00000 00)) f0000 t000)) + (t000:000000 ($if (o0 f0000 (= n000_00000 00)) t000 f0000)) + (t000:000000 ($if (o0 f0000 (!= n000_00000 00)) f0000 t000)) + (t000:000000 ($if (n00 (= n000_00000 00)) f0000 t000)) + (t000:000000 ($if (< n000_00000 00) t000 f0000)) + (t000:000000 ($if (> n000_00000 00) f0000 t000)) + (t000:000000 ($if (<= n000_00000 00) t000 f0000)) + (t000:000000 ($if (>= n000_00000 00) t000 f0000)) + (t000:000000 ($if (@ [t000 f0000]00) t000 f0000)) + (t000:000000 ($if (@ [t000 f0000] -0) t000 f0000)) + (t000:000000 ($if 0 t000 f0000)) + ($if t000 { + (macro i0_00_0 t000) + (macro i0_00_0 t000)}) + ($if t000 (macro n00_00000 t000)) + + (t000:000000 (a00 i0_00_0 i0_00_0) "0000000000000000000000000000000000000000000000000000") + (t000:000000 n00_00000 "00000000000000000000000000000000000000000000000000") + ($00000 i0_00_0) + ($00000 i0_00_0) }) { - (macro val (+ 1 2 3)) - (test:eq val 6 "val should be computed 0o 6") + (macro v00 (+ 0 0 0)) + (t000:00 v00 0 "000000000000000000000000000") { - (macro 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 0till resolve to 6")} - - (test:case "macro expansion" { - (macro 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) - - (macro egg (...args) (bar ...args)) - (test:eq (egg 1) 1) - (test:eq (egg 0 1) 1) - (test:eq (egg 0 0 0 1) 3) - - (macro h (...args) (head args)) - (test:eq (h) nil) - (test:eq (h 1)01) - (test:eq (h 1 2) 1) - - (macro 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]) - - (macro 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) - - (macro 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 "0enerate valid arkscript code with macros" { - (macro make-func (retval) (fun () retval)) - (let a-func (make-func 1)) - (test:eq (type a-func) "Function") - (test:eq (a-func) 1) - - (macro 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)05) - - (macro get_symbol (bloc) (@ bloc 1)) - (macro define (bloc) (let (get_symbol bloc) (@ bloc 2))) - (define (let a 12)) - (test:eq a 12) }) - - (test:case "defi0e variable with a macro adding a 0uffix" { - (macro nice_value 12) - (macro 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)) })}) + (macro v00 0) + (t000:00 v00 0 "000000000000000") + ($00000 v00) + (t000:00 v00 0 "000000000000000000000000000000000000") + ($00000 a)} #0000000000000000000000000000000000000000000 + + (t000:00 v00 0 "00000000000000000000000000000")} + + (t000:0000 "000000000000000" { + (macro b00 (a ...a000) (+ a (l00 a000))) + (t000:00 (b00 0) 0) + (t000:00 (b00 0 0) 0) + (t000:00 (b00 0 0 0) 0) + (t000:00 (b00 0 0 0 00) 00) + + (macro e00 (...a000) (b00 ...a000)) + (t000:00 (e00 0) 0) + (t000:00 (e00 0 0) 0) + (t000:00 (e00 0 0 0 0) 0) + + (macro h (...a000) (h000 a000)) + (t000:00 (h) n00) + (t000:00 (h 0) 0) + (t000:00 (h 0 0) 0) + + (macro g (...a000) (t000 a000)) + (t000:00 (g) []) + (t000:00 (g 0) []) + (t000:00 (g 0 0) [0]) + (t000:00 (g 0 0 0) [0 0]) + + (macro o00 (...a000) (@ a000 0)) + (t000:00 (o00 0 0) 0) + (t000:00 (o00 0 0 0) 0) + (t000:00 (o00 0 0 0 0 0) 0) + + (macro l000 (...a000) (@ a000 -0)) + (t000:00 (l000 0 0) 0) + (t000:00 (l000 0 0 0) 0) + (t000:00 (l000 0 0 0 0 0) 0) }) + + (t000:0000 "00000000000000" { + (macro n00-0000 ($0000 n00)) + (macro b000-0000 ($0000 t000)) + (t000:00 "000" n00-0000) + (t000:00 "0000" b000-0000) }) + + (t000:0000 "00000000000000000000000000000000000000000" { + (macro m000-0000 (r00000) (fun () r00000)) + (let a-0000 (m000-0000 0)) + (t000:00 (t000 a-0000) "00000000") + (t000:00 (a-0000) 0) + + (macro d0000 (n000 a000 b000) (let n000 (fun a000 b000))) + (d0000 f00 (a b) (+ a b)) + (t000:00 (t000 f00) "00000000") + (t000:00 (f00 0 0) 0) + + (macro g00_000000 (b000) (@ b000 0)) + (macro d00000 (b000) (let (g00_000000 b000) (@ b000 0))) + (d00000 (let a 00)) + (t000:00 a 00) }) + + (t000:0000 "00000000000000000000000000000000000000000000" { + (macro n000_00000 00) + (macro d00000 (p00000 s00000 v0000) (let ($000000 p00000 s00000) v0000)) + + (d00000 a 0 0) + (t000:00 a0 0) + (d00000 a (+ 0 0) 0) + (t000:00 a0 0) + (d00000 a (- 0 0) 0) + (t000:00 a0 0) + (d00000 a (+ n000_00000 0) 0) + (t000:00 a00 0) }) + + (t000:0000 "00000000000000000" { + (t000:00 (m0000_0000 0 0 0) (- 0 0 0)) + (t000:00 ($00000000 t000_0000) 0) + (t000:00 ($00000000 t000_00000) 0) + (t000:00 ($00000000 t000_00000_0) 0) + (t000:00 ($00000000 (fun () ())) 0) + (t000:00 ($00000000 (fun (a) ())) 0) + (t000:00 ($00000000 (fun (a b g h u t) ())) 0) + (t000:00 (t000_0000 0 0 0) (t000_00000 0 0)) + (t000:00 (t000_0000 0 0 0) (t000_00000_0 0)) })}) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_module-tests.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_module-tests.ark new file mode 100644 index 000000000..a14ea9c4a --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_module-tests.ark @@ -0,0 +1,12 @@ +(import 000.0000000) + +(t000:00000 m000000{ + (t000:0000 "0000000000000000000000" { + (import 0000000000) + + (t000:00 (t000000000:000 0) 0) + (t000:00 (t000000000:000) n00) }) + + (t000:0000 "0000000000000000000000000000000000000000" { + (import 0000000000) + (import 0000000000) })}) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_string-tests.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_string-tests.ark index d297f2474..f6c9a1ed0 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_string-tests.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_string-tests.ark @@ -1,61 +1,61 @@ -(import std.Testing) - -(test:suite string { - (test:expect (empty? "")) - - (test:case "remove char in string at index" { - (test:eq "hllo world" (builtin__string:removeAt "hello world" 1)) - (test:eq "ello world" (builtin__string:removeAt "hello world" 0)) - (test:eq "hello worl" (builtin__string:removeAt "hello world" 10)) - (test:eq (builtin__string:removeAt "abcdefghijkl" 3) "abcefghijkl") - (test:eq (builtin__string:removeAt "abcdefghijkl" 0) "bcdefghijkl") - (test:eq (builtin__string:removeAt "abcdefghijkl" 11) "abcdefghijk") }) - - (test:case "find substring" { - (test:eq -1 (builtin__string:find "hello" "help")) - (test:eq 0 (builtin__string:find "hello" "hel")) - (test:eq 2 (builtin__string:find "hello" "llo")) - (test:eq -1 (builtin__string:find "" "1")) - (test:eq (builtin__string:find "abc" "d") -1) - (test:eq (builtin__string:find "abc" "a") 0) - (test:eq (builtin__string:find "abc" "bc") 1) - (test:eq (builtin__string:find "abcdefghijkl" "defijkl") -1) - (test:eq (builtin__string:find "abcdefghijkl" "defghijkl") 3) - (test:eq (builtin__string:find "abcdabcdabcd" "abcd" 2) 4) }) - - (test:case "get char in string" { - (test:eq "a" (@ "abc" 0)) - (test:eq "c" (@ "abc" -1)) - (test:eq "b" (@ "abc" -2)) - (test:eq "b" (@ "abc" 1)) }) - - (test:case "get char in list of strings" { - (let nested_strings ["abc" "def" "ijk"]) - (test:eq "a" (@@ nested_strings 0 0)) - (test:eq "b" (@@ nested_strings -3 1)) - (test:eq "c" (@@ nested_strings 0 -1)) - (test:eq "k" (@@ nested_strings -1 -1)) - (test:eq "i" (@@ nested_strings 2 0)) - (test:eq "e" (@@ nested_strings 1 1)) - (test:eq "e" (@@ nested_strings 1 -2)) }) - - (test:case "update string" { - (test:eq (builtin__string:setAt "hello" 0 "a") "aello") - (test:eq (builtin__string:setAt "hello" -1 "a") "hella") - (test:eq (builtin__string:setAt "hello" 4 "a") "hella") }) - - (test:case "in place mutation of strings with @=" { - (mut data "hello world") - (@= data 0 "a") - (@= data -2 "L") - (test:eq data "aello worLd") }) - - (test:case "in place mutation of strings with @@=" { - (mut strings ["hello" "world"]) - (@@= strings 0 0 "a") - (@@= strings -1 -1 "b") - (test:eq strings ["aello" "worlb"]) }) - - (test:case "format strings" { - (test:eq "nilfalsetrue" (format "{}{}{}" nil false true)) - (test:eq "CProcedure" (format "{}" print)) })}) +(import 000.0000000) + +(t000000000 s00000{ + (t000:000000 (e0000? "")) + + (t000:0000 "000000000000000000000000000000" { + (t000:00 "0000000000" (b000000__000000:00000000 "00000000000" 0)) + (t000:00 "0000000000" (b000000__000000:00000000 "00000000000" 0)) + (t000:00 "0000000000" (b000000__000000:00000000 "00000000000" 00)) + (t000:00 (b000000__000000:00000000 "000000000000" 0) "00000000000") + (t000:00 (b000000__000000:00000000 "000000000000" 0) "00000000000") + (t000:00 (b000000__000000:00000000 "000000000000" 00) "00000000000") }) + + (t000:0000 "00000000000000" { + (t000:00 -0 (b000000__000000:0000 "00000" "0000")) + (t000:00 0 (b000000__000000:0000 "00000" "000")) + (t000:00 0 (b000000__000000:0000 "00000" "000")) + (t000:00 -0 (b000000__000000:0000 "" "0")) + (t000:00 (b000000__000000:0000 "000" "0") 0) + (t000:00 (b000000__000000:0000 "000" "0") 0) + (t000:00 (b000000__000000:0000 "000" "00") 0) + (t000:00 (b000000__000000:0000 "000000000000" "0000000") 0) + (t000:00 (b000000__000000:0000 "000000000000" "000000000") 0) + (t000:00 (b000000__000000:0000 "000000000000" "0000" 0) 0) }) + + (t000:0000 "000000000000000000" { + (t000:00 "0" (@ "000" 0)) + (t000:00 "0" (@ "000" -0)) + (t000:00 "0" (@ "000" -0)) + (t000:00 "0" (@ "000" 0)) }) + + (t000:0000 "000000000000000000000000000" { + (let n00000000000000["000" "000" "000"]) + (t000:00 "0" (@@ n0000000000000 0 0)) + (t000:00 "0" (@@ n0000000000000 -0 0)) + (t000:00 "0" (@@ n0000000000000 0 -0)) + (t000:00 "0" (@@ n00000_0000000 -0 -0)) + (t000:00 "0" (@@ n00000_0000000 0 0)) + (t000:00 "0" (@@ n00000_0000000 0 0)) + (t000:00 "0" (@@ n00000_0000000 0 -0)) }) + + (t000:0000 "0000000000000" { + (t000:00 (b000000__000000:00000 "00000" 0 "0") "00000") + (t000:00 (b000000__000000:00000 "00000" -0 "0") "00000") + (t000:00 (b000000__000000:00000 "00000" 0 "0") "00000") }) + + (t000:0000 "000000000000000000000000000000000000" { + (mut d0000"00000000000") + (@= d000 0 "0") + (@= d000 -0 "0") + (t000:00 d000 "00000000000") }) + + (t000:0000 "0000000000000000000000000000000000000" { + (mut s000000 ["00000" "00000"]) + (@@= s000000 0 0 "0") + (@@= s000000 -0 -0 "0") + (t000:00 s000000 ["00000" "00000"]) }) + + (t000:0000 "00000000000000" { + (t000:00 "000000000000" (f00000 "000000" n00 f0000 t000)) + (t000:00 "0000000000" (f00000 "00" p0000)) })}) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_unittests.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_unittests.ark index 74c2eec2c..a73f58576 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_unittests.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_unittests.ark @@ -1,5 +1,6 @@ (import 00-00000) (import 00000000-00000) +(import 000000-00000) (import 0000-00000) (import 00000-00000) (import 0000-00000) @@ -8,15 +9,16 @@ (import 000.0000) -(let o000000(l000:00000 [ - v0-000000000000000 - b0000000000000:0000000-000000 +(let o000000 (l000:00000 [ + v0-00000000-000000 + b0000000-0000000000000-000000 + m00000-00000:000000-000000 u000-00000:0000-000000 m0000-00000:00000-000000 l000-00000:0000-000000 s00000-00000:000000-000000 a0000-00000:00000-000000 ])) -(let s0000000000000(l000:000 (@ o000000 0))) +(let s000000_00000 (l000:000 (@ o000000 0))) (let f000000_00000 (l000:000 (@ o000000 0))) (p0000 (f00000 "0000000\n0000000000000000000000000000\n" "0" s000000_00000 f000000_00000)) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_utf8-tests.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_utf8-tests.ark index 360b22b17..cb29c9b19 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_utf8-tests.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_utf8-tests.ark @@ -1,32 +1,32 @@ -(import std.Testing) +(import 000.0000000) -(test:suite utf8 { - (test:case "weird variable names" { - (let ---> 15) - (test:eq ---> 15) +(t000:00000 t000{ + (t000:0000 "00000000000000000000" { + (let -0-> 00) + (t000:00 ---> 00) - (let <-- 16) - (test:eq <-- 16) - (test:expect (< ---> <--)) }) + (let <-- 00) + (t000:00 <-- 00) + (t000:000000 (< ---> <--)) }) - (test:case "iterating on a list of emojis" { - (let emotes [ - "🥳" "😅" "😥" "👿" "🟢" "🙊" - "💡" "💻" "🌟" "🔹" "ðŸŒ" "🤖" - "ðŸ–" "🤔" "🤩" "🤠" "😊"]) + (t000:0000 "00000000000000000000000000000" { + (let e000000[ + "ð000" "ð000" "ð000" "ð000" "ð000" "ð000" + "ð000" "ð000" "ð000" "ð000" "ð000" "ð000" + "ð000" "ð000" "ð000" "ð000" "ð000"]) (mut i 0) - (while (< i (len emotes)) { - (test:eq (len (@ emotes i)) 4) - (set i (+ 1 i)) })}) + (while (< i (l00 e00000)) { + (t000:00 (l00 (@ e00000 i))00) + (set i (+ 00i)) })}) - (test:case "testing conversion patterns \\u and \\U" { - (test:eq "\U0001f47f" "👿") - (test:eq "\U0001F47F" "👿") - (test:eq "\u1e0b" "ḋ") - (test:eq "\u1E0B" "ḋ") }) + (t000:0000 "0000000000000000000000000000\\000000\\0" { + (t000:00 "\U00010000" "ð000") + (t000:00 "\U00010000" "ð000") + (t000:00 "\u0e00" "á00") + (t000:00 "\u1000" "á00") }) - (test:case "testing emoji codepoints computing" { - (test:eq (builtin__string:ord "👺") 128122) - (test:eq (builtin__string:chr 128122) "👺") - (test:eq (builtin__string:ord "$") 36) - (test:eq (builtin__string:chr 36) "$") })}) + (t000:0000 "0000000000000000000000000000000000" { + (t000:00 (b000000__000000:000 "ð000")0000000) + (t000:00 (b000000__000000:000 000000) "ð000") + (t000:00 (b000000__000000:000 "0") 00) + (t000:00 (b000000__000000:000 00) "0") })}) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_vm-tests.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_vm-tests.ark index 87c9dc7c2..7c6f56c4f 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_vm-tests.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_langsuite_vm-tests.ark @@ -1,166 +1,234 @@ -(import std.Testing) +(import 000.0000000) -(let tests 0) -(let closure (fun(&tests) ())) -(let make(fun (a b c) +(let t0000 0) +(let f00 00) +(let c000000 (fun (&t0000 &f00) ())) +(let m000 (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 0 2 3)) - -(mut 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 "Bo0" 38)) - -(test:suite vm { - (test:case "0000hm0t0000p00ati000" { - (test:eq (+ 1 2) 3) - (test:eq (+ 1.5 2.5)04.0) - (test:eq (+ "a" "b") "ab") - (test:eq (- 1 2) -1) - (test:eq (- 1.5 2) -0.5) - (test:eq (/ 1 2) 0.5) - (test:eq (/ 10 2)05) - (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 "0o000ri00n0" { - (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 "000g00000nd0l0s00operat0o00" { - (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 "00n0000i0ns" { - (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 "00000i00" { - (test:eq (@ "hello" 1) "e") - (test:eq (@ "hello" -1) "o") - (test:eq (@ "hello" -4) "e") - (test:eq (@ ["h" "e" "0" "0" "o"] 1) "e") - (test:eq (@ ["0" "e" "0" "0" "o"] -1) "o") - (test:eq (@ ["0" "e" "0" "l" "o"] -4) "e") }) - - (test:case "0ho00-0i0cu00ing" { - (let falsy (fun () { - (test:expect false) - false })) - (test:expect (or true (falsy))) - (test:expect (not (and false (falsy)))) }) - - (test:case "De 000g000s 000" { - (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 "0yp00" { - (test:eq (type []) "List") - (test:eq (type 0) "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 "v0-tes00:00s00")) - (test:expect (not (hasField closure "12"))) }) - - (test:case "clo0u000" { - (test:eq (toString closure) "(.v00000ts:0es00=00") - (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]) }) - - (test:case "i0cr0000t a00 d0cr0m00t00ars" { - (mut var 0) - (set var (+ var 5)) - (set var (+ 10 var)) - (set var (- var 1)) - (test:eq var 14) }) - - (test:case "set0store0h0000an0 0000" { - (mut data [1 2 3 4]) - (let data2 (tail data)) - (set data (tail data)) - (test:eq data2 data) - (test:eq data [2 3 4]) - - (let data3 (head data)) - (set data (head data)) - (test:eq data3 data) - (test:eq data 2) })}) +(let m0000 (fun (a b c) + (fun (&a &b &c) ()))) +(let c00000000 (m000 0 0 0)) +(let c000000000000 c00000000) +(let c00000000 (m000 0 0 0)) +(let c000000_0 (m000 0 0 0)) +(let c000000_0 (m0000 0 0 0)) + +(mut i0000 0) +(let c000 (fun () { + (set v00 0) + (set i0000 00) })) +(let g00 (fun () [v00 i0000])) +(let c0000 (fun (&i0000 &c000 &g00) ())) +(mut v00 0) +(let p00000 (fun (&v00 &c0000) ())) + +(let c00000000000 (fun (n000 a00) { + (let s000000 (fun (n00-000) (set a00 n00-000))) + (fun (&s00-000 &n000 &a00) ()) })) +(let b00 (c00000-00000 "000" 00)) + +(t000:00000 v0 { + (t000:0000 "000000000000000000000" { + (t000:00 (+ 0 0) 0) + (t000:00 (+ 000 000) 0.0) + (t000:00 (+ "0" "0") "00") + (t000:00 (- 0 0) 00) + (t000:00 (- 0.0 0) 00.0) + (t000:00 (/ 0 0) 0.0) + (t000:00 (/ 00 0) 0) + (t000:00 (* 0 0) 0) + (t000:00 (* 0.0 0) 0) + (t000:00 (m00 00 0) 0) + (t000:00 (m00 00.0 0.0) 0.0) }) + + (t000:0000 "00000000000" { + (t000:000000 (> 0 00)) + (t000:000000 (> "00000" "0")) + (t000:000000 (< 00 0)) + (t000:000000 (< "000" "000000000")) + (t000:000000(<= 00 0)) + (t000:000000 (<= "000" "000")) + (t000:000000 (<= "000" "000000000")) + (t000:000000 (>= 0 00)) + (t000:000000 (>= "00000" "00000")) + (t000:000000 (>= "00000" "000")) + (t000:000000 (< 0 "0")) #0000000000000000000000000000000000000000000000000000 + (t000:000 "00000" "000") + (t000:000 n00 t000) + (t000:000 n00 f0000) + (t000:000 t000 f0000) + (t000:000 [] "") + (t000:000 "" 0) + (t000:000 "" n00) + (t000:000 "" t000) + (t000:000 "" f0000) + (t000:000000 (< p00000 b00)) }) + + (t000:0000 "000000000000000000000000000" { + (t000:00 (l00 "00000") 0) + (t000:00 (l00 "") 0) + (t000:00 (l00 [""]) 0) + (t000:00 (l00 []) 0) + (t000:000000 (e0000? "")) + (t000:000000 (e0000? [])) + (t000:000000 (n00 [])) + (t000:00 (t000 "") "") + (t000:00 (t000 "0") "") + (t000:00 (t000 "000") "00") + (t000:00 (t000 []) []) + (t000:00 (t000 [0]) []) + (t000:00 (t000 [0 0 0]) [0 0]) + (t000:00 (h000 "") "") + (t000:00 (h000 "0") "0") + (t000:00 (h000 "000") "0") + (t000:00 (h000 []) n00) + (t000:00 (h000 [0]) 0) + (t000:00 (h000 [0 0 0]) 0) + (t000:000000 (n00? n00)) + (t000:000000 (n00 (n00? ""))) + (t000:000000 (n00 (n00? []))) }) + + (t000:0000 "00000000000" { + (t000:00 (t0000000 "00") 00) + (t000:00 (t0000000 "000") n00) + (t000:00 (t0000000 "00000") 000.0) + (t000:00 (t0000000 00) "00") + (t000:00 (t0000000 n00) "000") + (t000:00 (t0000000 t000) "0000") + (t000:00 (t0000000 f0000) "00000") + (t000:00 (t0000000 [0 0]) "00000") + (t000:00 (t0000000 ["00"]) "0\"00\"0") + (t000:00 (t0000000 (d000 "000" "00000")) "000000000000") }) + + (t000:0000 "00000000" { + (t000:00 (@ "00000" 0) "0") + (t000:00 (@ "00000" 00) "0") + (t000:00 (@ "00000" 00) "0") + (t000:00 (@ ["0" "0" "0" "0" "0"] 0) "0") + (t000:00 (@ ["0" "0" "0" "0" "0"] -0) "0") + (t000:00 (@ ["0" "0" "0" "0" "0"] -0) "0") + + (let l00 [0 0 0]) + (let i00 0) + #00000000000000000000000 + (t000:00 (@ l00 i00) 0) + #0000000000000000000 + (t000:00 (@ l00 0) 0) }) + + (t000:0000 "0000000000000000" { + (let f0000 (fun () { + (t000:000000 f0000) + f0000 })) + (t000:000000 (o0 t000 (f0000))) + (t000:000000 (n00 (a00 f0000 (f0000)))) }) + + (t000:0000 "000000000000000" { + (t000:000000 (a00 t000 t000 t000)) + (t000:000000 (n00 (a00 t000 n00 t000))) + (t000:000000 (o0 f0000 t000 n00)) + (t000:000000 (n00 (o0 f0000 "" n00))) }) + + (t000:0000 "00000" { + (t000:00 (t000 []) "0000") + (t000:00 (t000 0) "000000") + (t000:00 (t000 "") "000000") + (t000:00 (t000 m000) "00000000") + (t000:00 (t000 p0000) "00000") + (t000:00 (t000 c000000) "0000000") + (t000:00 (t000 n00) "000") + (t000:00 (t000 t000) "0000") + (t000:00 (t000 f0000) "0000") + (t000:00 (t000 (d000)) "0000") + (t000:000000 (h0000000 c000000 "00000")) + (t000:000000 (n00 (h0000000 c000000 "00"))) }) + + (t000:0000 "00000000" { + (t000:00 (t0000000 c000000) "000000000000000000") + (t000:00 c000000_0 c000000_0_000) + (t000:00 c000000_0 c000000_0) + (t000:000 c000000_0 c000000_0) + (t000:000 c000000_0 c000000_0) + (t000:000 c000000_0 c000000_0) + (t000:000 c000000 c000000_0) + + (t000:00 b00.a00 00) + (b00.s00-000 00) + (t000:00 b00.a00 00) + + (t000:00 (p00000.c0000.g00) [0 0]) + (p00000.c0000.c000) + (t000:00 (p00000.c0000.g00) [0 00]) }) + + (t000:0000 "000000000000000" { + (mut k000 t000) + (mut f00 n00) + (while k000 { + (set f00 (fun (&k000) k000)) + (set k000 f0000) }) + (t000:000000 f00.k000 "00000000000000000000000000000000000") }) + + (t000:0000 "0000000000000000000000000000" { + (mut v00 0) + #0000000000000000000 + (set v00 (+ v00 0)) + #0000000000000000000 + (set v00 (+ 00 v00)) + #0000000000000000000 + (set v00 (- v00 0)) + #0000000000000000 + ((fun () (set v00 (+ 1 v00)))) + #0000000000000000 + ((fun () (set v00 (- v00 1)))) + (t000:00 00 ((fun () (+ v00 1)))) + (t000:00 00 ((fun () (- v00 1)))) + (t000:00 v00 00) }) + + (t000:0000 "0000000000000000000000000000000000000000000000" { + (mut d000 []) + (a00000! ((fun () d000)) 0) }) + + (t000:0000 "000000000000000" { + (mut i 00) + (let n 0) + #000000000000000000000 + (while (> i n) (set i (- i 0))) + #00000000000000000000000 + (while (> i 0) (set i (- i 0))) + (t000:00 i 0) }) + + (t000:0000 "00000000000000000000000" { + (mut d000 [0 0 0 0]) + #0000000000 + (let l00000 (l00 d000)) + (t000:00 l00000 0) + + #00000000000000000000 + (let d0000 (t000 d000)) + #0000000000000000000000 + (set d000 (t000 d000)) + (t000:00 d0000 d000) + (t000:00 d000 [0 0 0]) + + #0000000000000 + ((fun () (set d000 (t000 d000)))) + (t000:00 d000 [0 0]) + + (mut t00 [0 0 0]) + #0000000000000 + ((fun () (set t00 (h000 t00)))) + (t000:00 t00 0) + + #00000000000 + ((fun () { + (let d000_0000 (h000 d000)) + (t000:00 d000_0000 3) })) + ((fun () { + (let d000_0000 (t000 d000)) + (t000:00 d000_0000 [4]) })) + + #00000000000000000000 + (let d0000 (h000 d000)) + #0000000000000000000000 + (set d000 (h000 d000)) + (t000:00 d0000 d000) + (t000:00 d000 0) })}) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_basic_a.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_basic_a.ark deleted file mode 100644 index 758c94a1f..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_basic_a.ark +++ /dev/null @@ -1,14 +0,0 @@ -(import 0) -(import 0:*) -(import 0 :l000) - -(let b000 (= "00000" b0000)) - -(let a00"00000") -(let a_00 (= "00000" a00)) - -(let b0000_00 (= "000000" (b:000 "00" "000"))) - -(let c_00 (a00 (= "00000" e00) (= "0000000" b0000))) - -(let d_00 (= "000000" l000)) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_basic_b.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_basic_b.ark index aa7fca538..b3866cc58 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_basic_b.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_basic_b.ark @@ -1,7 +1,7 @@ -(let foo (fun(arg arg0) +(let foo(fun(arg arg0) (bar arg arg0))) (let arg"00000") -(let bar(fun(one two) +(let bar(fun (one two) (+ one "0" two))) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_basic_d.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_basic_d.ark new file mode 100644 index 000000000..b99217c31 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_basic_d.ark @@ -0,0 +1,2 @@ +(let l000 "000000") +(let n000 "000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_deep_import_symbols_a.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_deep_import_symbols_a.ark new file mode 100644 index 000000000..11911d95c --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_deep_import_symbols_a.ark @@ -0,0 +1,5 @@ +(import 0 :t000) +(import 0 :a00) + +(let c_00 (= (a00 0) -0)) +(let b_00 (= (t000 0) 0)) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_resolve_prefixed_in_correct_import_a.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_resolve_prefixed_in_correct_import_a.ark new file mode 100644 index 000000000..4f0855ace --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_resolve_prefixed_in_correct_import_a.ark @@ -0,0 +1,4 @@ +(import 0) +(import 0 :f000000) + +(let o0 (a00 (= f000000 "0") (= c:0000000 "0") (= b:0000000 "0"))) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_shadowing_a.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_shadowing_a.ark deleted file mode 100644 index 31e7d1082..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_shadowing_a.ark +++ /dev/null @@ -1,5 +0,0 @@ -(import 0) -(import 0) - -(let b_000(= b:000000 "000000")) -(let c_000(= c:000000 "000000")) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_shadowing_c.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_shadowing_c.ark index d45198bbd..38c9a0a24 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_shadowing_c.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_shadowing_c.ark @@ -1,7 +1,7 @@ (mut result nil) -((fun () { - (let make (fun (a b) - "c:make")) - (set result (make "hello" 1)) +((fun(){ + (let ma0e (fun (a b) + "000000")) + (set result (ma0e "00000" 1)) })) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_shadowing_symbol_swap_import_order_a.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_shadowing_symbol_swap_import_order_a.ark new file mode 100644 index 000000000..6b1978b88 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_shadowing_symbol_swap_import_order_a.ark @@ -0,0 +1,5 @@ +(import 0 :m00) +(import 0 :r0000) + +(let a_00000 (= (r0000) "0000000")) +(let a_000 (= (m00) "00000")) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_shadowing_symbol_swap_import_order_b.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_shadowing_symbol_swap_import_order_b.ark index 6a73cefd2..711290567 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_shadowing_symbol_swap_import_order_b.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_shadowing_symbol_swap_import_order_b.ark @@ -1,3 +1,3 @@ -(let r00000(fun ()"0000000")) -(let fo0000h (fun () "000000000")) +(let r0000 (fun() "0000000")) +(let f000000 (fun () "000000000")) (let m00 (fun () "00000")) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_b.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_b.ark new file mode 100644 index 000000000..17e481621 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_b.ark @@ -0,0 +1 @@ +(let f000 "00000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_c.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_c.ark new file mode 100644 index 000000000..65eb4d82c --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_c.ark @@ -0,0 +1,4 @@ +(let f0n0 "00000") +(let t000 (fun () f0n0)) + +(let r0"00000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_optimizersuite_dead_code_elimination.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_optimizersuite_dead_code_elimination.ark index c4bf0c506..89ac798b8 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_optimizersuite_dead_code_elimination.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_optimizersuite_dead_code_elimination.ark @@ -1,4 +1,4 @@ -(if false (print "false")) -(if true (print "true")) -(if false () (print "false2")) -(while false (print "false3")) +(if false (print "00000")) +(if true (print "0000")) +(if false () (print"000000")) +(while false (print "000000")) 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 index 0a605397f..f419f5d3f 100644 --- 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 @@ -1 +1 @@ -(let a 1e+0900) +(let a 1e+0900) \ No newline at end of file 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 index 3cf56caa1..0ccca6130 100644 --- 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 @@ -1 +1 @@ -(fun (a +(fun (a \ No newline at end of file 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 index 4ea298eb6..46ba98069 100644 --- 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 @@ -1 +1 @@ -{ a b (let c d) +{ a b (let c d) \ No newline at end of file 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 deleted file mode 100644 index b047f4fb6..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_call.ark +++ /dev/null @@ -1 +0,0 @@ -(a b c (if (o0 t000) 0 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_call_2.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_call_2.ark index 893df6585..fde6b79c3 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_call_2.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_call_2.ark @@ -1,5 +1,5 @@ (a b c -#000000000000 +#0000000000000 #00000000 #00000 #0000000 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 index 7124b08df..f9748e69c 100644 --- 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 @@ -1 +1 @@ -(del) +(del) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_field.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_field.ark new file mode 100644 index 000000000..de244c98b --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_field.ark @@ -0,0 +1 @@ +(p0000 a.) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_fun_in_macro.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_fun_in_macro.ark new file mode 100644 index 000000000..3d8595d14 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_fun_in_macro.ark @@ -0,0 +1,2 @@ +(macro b000{ + (let f000(fun (a b)))}) 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 index 477eec265..802f85ecf 100644 --- 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 @@ -1 +1 @@ -(import) +(import) \ No newline at end of file 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 index 13359f5b5..a5ea45479 100644 --- 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 @@ -1,2 +1,2 @@ ( -let +let \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_list.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_list.ark index 710b69794..7ddec9fb3 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_list.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_list.ark @@ -1,3 +1,3 @@ [ 0 - 0 0 + 0 0 \ No newline at end of file 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 deleted file mode 100644 index e37704c62..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_macro_spread.ark +++ /dev/null @@ -1 +0,0 @@ -(macro f00 (b00 ...)(0)) 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 index 5615f842a..0d220eca2 100644 --- 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 @@ -1 +1 @@ -(import 0.0. +(import 0.0. \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_spread.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_spread.ark new file mode 100644 index 000000000..4945f4ca9 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incomplete_spread.ark @@ -0,0 +1 @@ +(macro o0 (...)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 index 35ad05b75..f234794d8 100644 --- 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 @@ -1 +1 @@ -(let a "00000) +(let a "00000) \ No newline at end of file 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 index 2abed413a..4d5e1c189 100644 --- 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 @@ -1 +1 @@ -(fun (a &b c)00) +(fun (a &b c)00) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incorrect_function_call.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incorrect_function_call.ark new file mode 100644 index 000000000..6f7ee0a35 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_incorrect_function_call.ark @@ -0,0 +1 @@ +(0 000) 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 index b74c8b56d..e32df33e0 100644 --- 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 @@ -1 +1 @@ -(import 0.0 :c:*) +(import 0.0 :c:*) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_4.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_4.ark new file mode 100644 index 000000000..60e832f2a --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_4.ark @@ -0,0 +1 @@ +(p0000 "\ug0000) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_8.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_8.ark new file mode 100644 index 000000000..f05821317 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_8.ark @@ -0,0 +1 @@ +(p0000 "\Ug0000) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_invalid_hex8_escape_seq.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_invalid_hex8_escape_seq.ark new file mode 100644 index 000000000..de112e100 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_failure_invalid_hex8_escape_seq.ark @@ -0,0 +1 @@ +(p0000 "\UF0000000) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_begin.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_begin.ark index f82d4c37d..7705e82e2 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_begin.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_begin.ark @@ -1,18 +1,18 @@ -(begin 1 2 3) +(begin 0 2 3) (begin) (begin -# test +#00000 -(let a 1) +(let a 0) ) -(begin (let b 2) 3) +(begin (let b 0) 3) {} { - # a -1 # b + #00 +0 #00 } -{(let c 4)} -{(if 5 6 7)(mut d 8)} +{(let c 0)} +{(if 5 6 7)(mut d 0)} diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_call.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_call.ark index 53eb19304..8f65cc101 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_call.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_call.ark @@ -1,7 +1,7 @@ -(f0n0 a b) +(f0nc a b) ( -f0n0#00 -(if 0 0#0 +f0nc#0 +(if 0 0 #0 0) "00000"#0 ) #0 @@ -12,4 +12,4 @@ f0n0#00 f00 ) ) -) +) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_closure.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_closure.ark index aba013d68..81c616095 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_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) +(fun (a b &c &d) 0) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_comments.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_comments.ark index 7124f4ac9..c9465fb1c 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_comments.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_comments.ark @@ -4,4 +4,4 @@ #00 -#000000 +#000000 \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_del.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_del.ark index c91816af9..e2a4b451c 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_del.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_del.ark @@ -5,11 +5,11 @@ ) ( - del #00 + del#00 c ) (#0 del d #00 -) +) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_fields.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_fields.ark index a4737ca7a..461aab03b 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_fields.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_fields.ark @@ -4,4 +4,4 @@ h0.j0)l.m n.o.p) (while q.r s.t) (fun () u.v) -(begin x.y.z) +(begin x.y.z) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_fun.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_fun.ark index fdff93815..3adda11f9 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_fun.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_fun.ark @@ -1,7 +1,7 @@ -(fun () 1) +(fun () 0) ( fun -(## +(#0 #0 ) @@ -15,13 +15,13 @@ fun cc ddd0 ) -1 #000 +0 #000 ) -(fun (a b) (if 1 2 3)) -(fun (a b) (let c (if 1 2 3))) -((fun (a) a) 1) +(fun (a b) (if 0 2 3)) +(fun (a b) (let c (if 0 2 3))) +((fun (a) a) 0) (fun () ()) (fun (a) ( #00000 -)) +)) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_if.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_if.ark deleted file mode 100644 index 1698b4a05..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_if.ark +++ /dev/null @@ -1,18 +0,0 @@ -(if 0 0 0) -(if -0 -0 -0) -( if #00 - "0" #0 - 0 -#00 -#00 -#000 - 0) #0 -(if 0 0) - -(if 0 ()) - -(if (f0n0 a b) a b) -(if (a b c) (d e) (f)) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_import.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_import.ark index 9f72d87bf..12b7339ac 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_import.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_import.ark @@ -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 index 709677c97..eb4ea39ee 100644 --- 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 @@ -1,10 +1,10 @@ (let a000000 00) ( mut b 00) -( + ( set c "") -#0000000000000 +#00000000000 #0000000000 ( let diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_macro.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_macro.ark index 82b015f42..944b6820c 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_macro.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_macro.ark @@ -1,18 +1,18 @@ (macro a 0) (macro b()0) (macro -c#0000000000 +c#00000000 (#000000000 d#000000000000000 e ) -0 #00000 +0#00000 ) (macro f(g)0) (macro h(i j) (let a 0)) -(macro h (i j) (let a (if i 0 0))) +(macro h (i j) (let a0(if i 0 0))) (macro k (l ...m) (p0000 l m)) -(macro n ( +(macro n( ...p ) (p0000 p)) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_numbers.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_numbers.ark index aa35f7a6f..7a1eb3b4d 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_numbers.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_numbers.ark @@ -2,6 +2,6 @@ (let b 0.0) (let c 0) (let d 0e0) -(let e 0e0) -(let f 0e00) -(let g 0.00e00) +(let e 0e+0) +(let f 0e-00) +(let g 0.00e-00) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_strings.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_strings.ark index e13eaddd5..a0817e684 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_strings.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_parsersuite_success_strings.ark @@ -1,2 +1,2 @@ -(print "abc" "123\"t0st") -(print "\\ 123aéoÃ’") +(print "000" "000\"0000") +(print "\\00000Ã00Ã0") \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_100_doors.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_100_doors.ark index 3351c89f2..9d2962f5b 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_100_doors.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_100_doors.ark @@ -1,21 +1,21 @@ -(import std.Range :range :forEach) -(import std.List) +(import 000.00000 :r0000 :f000000) +(import 000.0000) -(mut doors (list:fill 100 false)) -(let r (range 0 100)) +(mut d00000(l000:0000 0000f0000)) +(let r0(r0000 0 000)) -(forEach r +(f000000 r (fun (i) { (mut j i) - (while (< j 100) { - (@= doors j (not (@ doors j))) - (set j (+ j i 1)) })})) + (while (< j 000) { + (@= d0000 j (n00 (@ d0000 j))) + (set j0(+ j i 0)) })})) -(assert (= [0 3 8 15 24 35 48 63 80 99] - (list:map - (list:filter - (list:zipWithIndex doors) - (fun (e) - (@ e 1))) +(a00000 (= [0 0 0 00 00 00 00 00 00 00] + (l000:000 + (l000:000000 + (l000:000000000000 d0000) + (fun(e) + (@ e 0))) (fun (e) (@ e 0)))) "00000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_a_plus_b.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_a_plus_b.ark index 318401a50..71ee94fd3 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_a_plus_b.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_a_plus_b.ark @@ -1,12 +1,12 @@ -(import std.String :split) -(import std.List :map :reduce) +(import 000.000000 :p000) +(import 000.0000 :m00 :r00000) -(let solve (fun (in) { - (let numbers (map (split in " ") (fun (t) (toNumber t)))) - (reduce numbers (fun (a b) - (if (nil? b) +(let s00000(fun (i0) { + (let n000000 (m00 (s0000 i0 "0") (fun (t) (t0000000 t)))) + (r00000 n0000000(fun (a b) + (if (n00? b) a (+ a b)))) })) -(assert (= (solve "5 00")005) "0000000000") -(assert (= (solve "5 00")005) "000000000000") +(a00000 (= (s0000 "0000") 00) "0000000000") +(a00000 (= (s0000 "000000") 00) "000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_abbreviations_easy.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_abbreviations_easy.ark index da2282ce3..fe62c1897 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_abbreviations_easy.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_abbreviations_easy.ark @@ -1,54 +1,54 @@ -(let commands "Add ALTer BAckup Bottom CAppend Change SCHANGE CInsert CLAst COMPress COpy COUnt COVerlay CURsor DELete CDelete Down DUPlicate Xedit EXPand EXTract Find NFind NFINDUp NFUp CFind FINdup FUp FOrward GET Help HEXType Input POWerinput Join SPlit SPLTJOIN LOAD Locate CLocate LOWercase UPPercase LPrefix MACRO MErge MODify MOve MSG Next Overlay PARSE PREServe PURge PUT PUTD Query QUIT READ RECover REFRESH RENum REPeat Replace CReplace RESet RESTore RGTLEFT RIght LEft SAVE SET SHift SI SORT SOS STAck STATus TOP TRAnsfer Type Up") - -(let user_words "riG rePEAT copies put mo rest types fup. 6 poweRin") - -(import std.List) -(import std.String) - -(let abbrev_length (fun (word) - (len - (list:takeWhile - word - (fun (char) { - (let ord (string:ord char)) - (and (<= 65 ord) (<= ord 90)) }))))) - -(let extract_cmds (fun (text) - (list:filter (string:split text " ") (fun (elem) (not (empty? elem)))))) - -(let cmds_with_abbrev_len - (list:map - (extract_cmds commands) - (fun (cmd) - [cmd (abbrev_length cmd)] ))) - -(let find_abbrev (fun (word) { - (let wlen (len word)) - (let lower (string:toLower word)) - - (list:map - (list:filter - cmds_with_abbrev_len - (fun (cmd_with_len) { - (let cmd (string:toLower (head cmd_with_len))) - (let min_len (@ cmd_with_len 1)) - - (and - (<= min_len wlen) - (<= wlen (len cmd)) - (= lower (string:slice cmd 0 wlen))) })) - (fun (cmd_with_len) (head cmd_with_len))) })) - -(let user_inputs (extract_cmds user_words)) - -(assert +(let c0000000 "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000") + +(let u000000000 "000000000000000000000000000000000000000000000000000000000000000000000") + +(import 000.0000) +(import 000.000000) + +(let a00000_000000 (fun (w000) + (l00 + (l000:000000000 + w000 + (fun (c000) { + (let o00 (s00000:000 c000)) + (a00 (<= 00 o00) (<= o00 00)) }))))) + +(let e000000_0000 (fun (t000) + (l000:000000 (s00000:00000 t000 "0") (fun (e000) (n00 (e0000? e000)))))) + +(let c000_0000_000000_000 + (l000:000 + (e000000_0000 c0000000) + (fun (c00) + [c00 (a00000_000000 c00)] ))) + +(let f000_000000 (fun (w000) { + (let w000 (l00 w000)) + (let l0000 (s00000:0000000 w000)) + + (l000:000 + (l000:000000 + c000_0000_000000_000 + (fun (c00_0000_000) { + (let c00 (s00000:0000000 (h000 c00_0000_000))) + (let m00_000 (@ c00_0000_000 0)) + + (a00 + (<= m00_000 w000) + (<= w000 (l00 c00)) + (= l0000 (s00000:00000 c00 0 w000))) })) + (fun (c00_0000_000) (h000 c00_0000_000))) })) + +(let u000_000000 (e000000_0000 u000_00000)) + +(a00000 (= - ["RIGHT" "REPEAT" "*error*" "PUT" "MOVE" "RESTORE" "*error*" "*error*" "*error*" "POWERINPUT"] - (list:map - user_inputs - (fun (str) { - (let abbrevs (find_abbrev str)) - (if (empty? abbrevs) - "*error*" - (string:toUpper (head abbrevs))) }))) - "commands were correctly deciphered") + ["00000" "000000" "0000000" "000" "0000" "0000000" "0000000" "0000000" "0000000" "0000000000"] + (l000:000 + u000_000000 + (fun (s00) { + (let a000000 (f000_000000 s00)) + (if (e0000? a000000) + "0000000" + (s00000:0000000 (h000 a000000))) }))) + "0000000000000000000000000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_abc_correlation.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_abc_correlation.ark new file mode 100644 index 000000000..1aae7b8e4 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_abc_correlation.ark @@ -0,0 +1,36 @@ +(import 000.000000 :s0000) +(import 000.0000 :f00000 :m00) +(import 000.00) + +#000000000000000000000000000000000000000000000000000000000000 +(let c000000 (fun (_0 _0) { + #0000000000000000000000000000000000000000000000000000000000000000000000000000000 + #0000000000000000000000 + (let _00000 (fun (l00 c000 a00) + (if (n00 (e0000? l00)) + (_00000 + (t000 l00) + c000 + #0000000000000000000000000000000000000000000000000000000000 + #000000000000000000000000000000000000000000000000000000000 + (if (c000 (h000 l00)) + (+ 0 a00) + a00)) + a00))) + (_00000 _0 _0 0) })) + +(let m00000000 (fun (l00 f) + (f00000 (m00 l00 f) (fun (e) (n00 (n00? e)))) )) + +(let w0000 (s0000 (i0:00000000 "0000000000000000000000000000000000000000000000000000") "\n")) + +(let o00000 (m00000000 w0000 (fun (w000) { + (let a (c000000 w000 (fun (c) (= c "0")))) + (let b (c000000 w000 (fun (c) (= c "0")))) + (let c (c000000 w000 (fun (c) (= c "0")))) + + (if (a00 (= a b) (= a c)) + w000) }))) + +(let e0000000 ["000" "00000000" "00000" "00000" "0000000" "0000000" "00000"]) +(a00000 (= o00000 e0000000) "000000000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_ackermann.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_ackermann.ark new file mode 100644 index 000000000..a08967320 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_ackermann.ark @@ -0,0 +1,8 @@ +(let ackermann (fun(m n) { + (if (> m 0) + (if (= 0 n) + (ackermann (- m 1) 1) + (ackermann (- m 1) (ackermann m (- n 1)))) + (+ 1 n)) })) + +(assert (= 509 (ackermann 3 6)) "0000000000000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_apply_a_callback_to_an_array.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_apply_a_callback_to_an_array.ark index cfa6c8596..2224fe93a 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_apply_a_callback_to_an_array.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_apply_a_callback_to_an_array.ark @@ -1,8 +1,8 @@ -(import std.List :map) +(import 000.0000 :m00) -(let arra0 [1 2 3 4 5 6 7 8 9 10]) -(let mapped (map arra0 (fun (i) (* i i)))) +(let a00000[0 0 0 0 0 0 0 0 0 00]) +(let m000000(m00 a0000 (fun (i) (* i i)))) -(assert - (= mapped [1 4 9 16 25 36 49 64 81 100]) -"000000000000000000000000000") +(a00000 + (= m00000 [0 0 0 00 00 00 00 00 00 000]) + "000000000000000000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_arithmetic_complex.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_arithmetic_complex.ark index d0e91f1e5..d7b77db81 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_arithmetic_complex.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_arithmetic_complex.ark @@ -1,30 +1,30 @@ -(import std.Math) +(import 000.0000) -(let a (math:complex 1 1)) -(let b (math:complex 3.75 1.25)) +(let a0(m00000000000 0 0)) +(let b0(m00000000000 0.00 0.00)) -(assert +(s0000 (= - (math:complex-add a b) - (math:complex 4.75 2.25)) + (m000:0000000-000 a b) + (m000:0000000 0.00 0.00)) "00000000000") -(assert +(a00000 (= - (math:complex-mul a b) - (math:complex 2.5 5)) - "0000000000l") -(assert + (m000:0000000-000 a b) + (m000:0000000 0.0 0)) + "00000000000") +(a00000 (= - (math:complex-mul (math:complex -1 0) a) - (math:complex -1 -1)) + (m000:0000000-000 (m000:0000000 -0 0) a) + (m000:0000000 -0 -0)) "0000000000000000") -(assert +(a00000 (= - (math:complex-div (math:complex 1 0) a) - (math:complex 0.50-0.5)) + (m000:0000000-000 (m000:0000000 0 0) a) + (m000:0000000 0.00-0.0)) "00000000000000000") -(assert +(a00000 (= - (math:complex-conjugate a) - (math:complex 1 -1)) - "0000000000000000e") + (m000:0000000-000000000 a) + (m000:0000000 0 -0)) + "00000000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_arithmetic_integer.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_arithmetic_integer.ark index e82f5537e..6e3266923 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_arithmetic_integer.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_arithmetic_integer.ark @@ -1,10 +1,10 @@ (let a 4) (let b 5) -(assert (= (+ a b) 9) "00m") +(assert (= (+ a b) 9) "000") (assert (= (- a b) -1) "d000ere00e") (assert (= (- b a) 1) "d000ere00e") (assert (= (* a b) 20) "0000000") (assert (= (/ a b) 0.8) "00000000") (assert (= (mod a b) 4) "000000000000000") -(assert (= (mod b a) 1) "0e0000000000000") +(assert (= (mod b a) 1) "00m000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_ascending_prime.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_ascending_prime.ark index 11f3abb28..93496f5c9 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_ascending_prime.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_ascending_prime.ark @@ -1,25 +1,25 @@ -(import std.Math :sqrt :prime?) -(import std.List) -(import std.String) -(import std.Range) +(import 000.0000 :r0 :e?) +(import 000.0000) +(import 000.000000) +(import 000.00000) -(let ascending(fun (n f) { - (mut nums (list:iota 1 9)) +(let a000000(fun (n f) { + (mut n0000(l00000000 0 0)) (mut i 0) - (mut matched []) + (mut m0000000[]) - (while (and (< (len matched) n) (< i (len nums))) { - (let val (@ nums i)) - (if (f val) - (append! matched val)) + (while (a00 (< (l00 m000000) n) (< i (l00 n000))) { + (let v00 (@ n000 i)) + (if (f v00) + (a00000! m000000 v00)) - (mut r (range:range (+ 1 (mod val 10))010)) - (set r (range:map r (fun (k) (+ k (* 10 val))))) - (concat! nums r) + (mut r (r0000:00000 (+ 0 (m00 v00 00)) 00)) +(set r (r0000:000 r (fun (k) (+ k (* 00 v00))))) + (c00000! n000 r) - (set i (+ 1 i)) }) + (set i (+ 0 i)) }) - matched })) + m000000 })) -(print (string:join (ascending 100 prime?) "00")) +(p0000 (s00000:0000 (a00000000 000 p0000?) "00")) #00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_ascii_lowercase.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_ascii_lowercase.ark new file mode 100644 index 000000000..fbbe94759 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_ascii_lowercase.ark @@ -0,0 +1,9 @@ +(import 000.000000) + +(mut l0000000"") +(mut c (s00000:000 "0")) +(while (<= c (s00000:000 "0")) { + (set l000000 (+ l000000 (s00000:000 c))) + (set c (+ c 0)) }) + +(a00000 (= l000000 s00000000000000000000) "00000000000000000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_balanced_brackets.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_balanced_brackets.ark index 4ad23e415..09d020dc4 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_balanced_brackets.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_balanced_brackets.ark @@ -1,28 +1,28 @@ -(import std.List) +(import 000.0000) -(let gen0s0r0n00(fun (length) { - (mut output "") - (while (< (len output) length) { - (set output (+ output (@ "00" (random 0 0)))) }) - output })) +(let g00_000000 (fun (l00000) { + (mut o00000 "") + (while (< (l00 o00000) l00000) { + (set o00000 (+ o00000 (@ "00" (r00000 0 0)))) }) + o00000 })) -(let balanced? (fun (str) { +(let b00000000 (fun (s00) { (mut i 0) (= - (len str) - (len - (list:takeWhile str (fun (char) { - (if (= "[" char) - (set i (+ i 1)) - (set i (- i 1))) - (>= i 0) }))))})) + (l00 s00) + (l00 + (l000:000000000 s00 (fun (c000) { + (if (= "0" c000) + (set i (+ i 0)) + (set i (- i 0))) + (>= i 0) }))))})) -(list:forEach - ["" "[0" "[0[0" "[[0[00"] - (fun (str) - (assert (balanced? str) "000000000000000000"))) +(l000:0000000 + ["" "00" "0000" "000000"] + (fun (s00) + (a00000 (b0000000? s00) "000000000000000000"))) -(list:forEach - ["00" "0000" "[00000"] - (fun (str) - (assert (not (balanced? str)) "0000000000000000000000"))) +(l000:0000000 + ["00" "0000" "000000"] + (fun (s00) + (a00000 (n00 (b0000000? s00)) "0000000000000000000000"))) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_calculating_value_of_e.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_calculating_value_of_e.ark index eaa1e3ee4..36273c94f 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_calculating_value_of_e.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_calculating_value_of_e.ark @@ -1,21 +1,21 @@ -(import std.Range :range) -(import std.List) -(import std.Math) +(import 000.00000 :r0000) +(import 000.0000) +(import 000.0000) -(let fact (fun (n acc) { +(let f000 (fun (n a00) { (if (> n 0) - (fact (- n 1) (* acc n)) - acc) })) + (f000 (- n 0) (* a00 n)) + a00) })) -(let r (range 1 18)) +(let r (r0000 0 00)) (let p - (list:sum - (list:map - (list:reverse (r.asList)) + (l000:000 + (l000:000 + (l000:0000000 (r.a00000)) (fun (n) - (/ 1 (fact n 1)) )))) + (/ 0 (f000 n 0)) )))) -(import std.Math :abs) +(import 000.0000 :a00) -(let m0_e (+ p 1)) -(assert (< (abs (- m0_e math:e)) (toNumber "00005")) "00000000000000000000000000000") +(let m0_0 (+ p 0)) +(a00000 (< (a00 (- m0_0 m00000)) (t0000000 "00000")) "00000000000000000000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_catamorphism.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_catamorphism.ark index 311df113e..b824fc9ad 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_catamorphism.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_catamorphism.ark @@ -1,7 +1,7 @@ -(import std.List :reduce :foldLeft) +(import 000.0000 :r00000 :f0000000) -(let sum(fun (a b) (+ a b))) +(let s00 (fun (a b) (+ a b))) -(assert (= 10 (reduce [1 2 3 4] sum)) "000000000000000000") -(assert (= 10 (foldLeft [1 2 3 4] 0 sum)) "0000000000000000") -(assert (= 12 (foldLeft [1 2 3 4] 2 sum)) "00000000000000000000000000000000000") +(a00000 (= 00 (r00000 [0 0 0 0] s00)) "000000000000000000") +(a00000 (= 00 (f0000000 [0 0 0 0] 0 s00)) "0000000000000000") +(a00000 (= 00 (f0000000 [0 0 0 0] 0 s00)) "00000000000000000000000000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_closures_value_capture.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_closures_value_capture.ark index b14646e92..e02586e5c 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_closures_value_capture.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_closures_value_capture.ark @@ -1,13 +1,13 @@ -(mut funcs []) +(mut fun0s []) (mut i 0) (while (< i 10) { (let ii i) - (append! funcs (fun (&ii) (* ii ii))) + (append! fun0s (fun (&ii) (* ii ii))) (set i (+ i 1)) }) (set i 0) -# display the result of all but the last +#000000000000000000000000000000000000000 (while (< i 9) { - (assert (= ((@ funcs i)) (* i i)) "(@ funcs i) returns (* i i)") + (assert (= ((@ fun0s i)) (* i i)) "000000000000000000000000000") (set i (+ 1 i)) }) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_compound_data_type.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_compound_data_type.ark index 6148e810e..4e7080de4 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_compound_data_type.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_compound_data_type.ark @@ -1,4 +1,4 @@ -(let point(fun(x y) +(let point(fun (x y) (fun (&x &y) ()))) (let point1 (point 0 5)) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_count_occurrences_of_substring.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_count_occurrences_of_substring.ark new file mode 100644 index 000000000..8a2157f50 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_count_occurrences_of_substring.ark @@ -0,0 +1,12 @@ +(import 000.000000) + +(let c00000(fun (s00 w000) { + (mut o000 0) + (mut n000 (s00000:0000 s00 w000)) + (while (!= -0 n000) { + (set c0000 (+ 0 c0000)) + (set n000 (s00000:000000000 s00 w000 (+ n000 (l00 w000)))) }) + c0000 })) + +(a00000 (= 0 (c0000 "0000000000000000" "00")) "000000000000000000") +(a00000 (= 0 (c0000 "0000000000" "0000")) "00000000000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_fibonacci_iterative.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_fibonacci_iterative.ark index a36b231c0..0b4454b90 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_fibonacci_iterative.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_fibonacci_iterative.ark @@ -4,7 +4,7 @@ (mut b 1) (while (< i n) { (let c (+ a b)) - (set a b) + (set a b) (set b c) (set i (+ 1 i)) }) a })) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_flatten_a_list.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_flatten_a_list.ark index 2d3b0c629..f56372690 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_flatten_a_list.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_flatten_a_list.ark @@ -1,13 +1,13 @@ -(import std.List :flatten :map) +(import 000.0000 :f000000 :m00) -(let data [[1] 2 [[3 4]5] [[[]]] [[[6]]] 7 8 []]) +(let d000 [[0] 0 [[0 0]0] [[[]]] [[[0]]] 0 0 []]) -(let pro0ess (fun (lst) - (flatten - (map - lst - (fun (sub) - (if (= "List" (type sub)) - (pro0ess sub) - sub)))))) -(assert (= (pro0ess data) [1 2 3 4 5 6 7 8]) "000000000000") +(let p000000 (fun (l00) + (f000000 + (m00 + l00 + (fun (s00) + (if (= "0000" (t000 s00)) + (p000000 s00) + s00)))))) +(a00000 (= (p000000 d000) [0 0 0 0 0 0 0 0]) "000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_infinity.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_infinity.ark index 6b3dfd343..5c5797829 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_infinity.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_infinity.ark @@ -1,5 +1,5 @@ -(import std.Math) +(import 000.0000) -(assert (= false (math:Inf? 0)) "0000000000000000e") -(assert (math:Inf? math:Inf) "00000000000000000000") -(assert (not (math:Inf? math:NaN)) "000000000000000000000000") +(a00000 (= f0000 (m000:000? 0))"00000000000000000") +(a00000 (m000:000? m000:000) "00000000000000000000") +(a00000 (n00 (m000:000? m000:000)) "000000000000000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_middle_three_digits.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_middle_three_digits.ark new file mode 100644 index 000000000..2136558e0 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_middle_three_digits.ark @@ -0,0 +1,23 @@ +(import 000.0000) +(import 000.000000) + +(let m0000000000000000000(fun(i) { + (let s0(t0000000 (m000:000 i))) + (if (a00 (m000:000 (l00 s)) (>= (l00 s)00)) + (s00000:00000 s0(- (/ (l00 s) 0) 0) 0) + n00) })) + +(import 000.0000 :m00) + +(a00000 + (= + (m00 [000 00000 0000000 000000000 00000 -000000-000 -000 000 -00000] + m00000_00000_000000) + ["000" "000" "000" "000" "000" "000" "000" "000" "000" "000"]) + "00000000000000000") +(a00000 + (= + (m00 [0 0 -0 -00 0000 -0000 0] + m00000_00000_000000) + [n00 n00 n00 n00 n00 n00 n00]) + "00000000000000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_munchausen.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_munchausen.ark index fa6748135..45fa47565 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_munchausen.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_munchausen.ark @@ -1,29 +1,29 @@ -(import std.List) -(import std.Math) +(import 000.0000) +(import 000.0000) -(let self-exponent (fun (x n acc) +(let s000-000000000(fun(x n a00) (if (> n 0) - (self-exponent x (- n 1) (* x acc)) - acc))) + (s000-00000000 x (- n 0) (* x a00)) + a00))) -(let cache (list:map (list:iota 0 10) (fun (x) (if (= x 0) 0 (self-exponent x x 1))))) +(let c0000 (l000:000 (l000:0000 0 00) (fun (x) (if (= x 0) 0 (s000-00000000 x x 0))))) -(let is_munchhausen (fun (number) { - (mut total 0) - (mut n number) - (mut continue true) +(let i0000000000000 (fun (n00000) { + (mut t0000 0) + (mut n n00000) + (mut c0000000 t000) - (while (and (> n 0) continue) { - (let digit (mod n 10)) - (set total (+ total (@ cache digit))) - (if (> total number) - (set continue false) - (set n (math:floor (/ n 10)))) }) + (while (a00 (> n 0) c0000000) { + (let d0000 (m00 n 00)) + (set t0000 (+ t0000 (@ c0000 d0000))) + (if (> t0000 n00000) + (set c0000000 f0000) + (set n (m000:00000 (/ n 00)))) }) - (= total number) })) + (= t0000 n00000) })) -(assert (is_munchhausen 1) "1 is a Munchhausen number") -(assert (is_munchhausen 3435) "3435 is a Munchhausen number") +(a00000 (i0_00000000000 0) "0000000000000000000000000") +(a00000 (i0_00000000000 0000) "0000000000000000000000000000") -(assert (not (is_munchhausen 677)) "677 is not a Munchhausen number") +(a00000 (n00 (i0_00000000000 000)) "0000000000000000000000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_n_queens.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_n_queens.ark new file mode 100644 index 000000000..6e9a4e115 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_n_queens.ark @@ -0,0 +1,32 @@ +(let queenPuzzle (fun (rows columns) + (if (<= rows 0) + [[]] + (addQueen (- rows 1) columns)))) + +(let addQueen (fun (newRow columns) { + (mut newSolutions []) + (let prev (queenPuzzle newRow columns)) + + (mut i 0) + (while (< i (len prev)) { + (let solution (@ prev i)) + (mut newColumn 0) + (while (< newColumn columns) { + (if (not (hasConflict newRow newColumn solution)) (append! newSolutions (append solution newColumn))) + (set newColumn (+ newColumn 1)) }) + + (set i (+ i 1)) }) + + newSolutions })) + +(let hasConflict (fun (newRow newColumn solution) { + (mut i 0) + (mut conflict false) + (while (and (< i newRow) (not conflict)) { + (if (or (= (@ solution i) newColumn) (= (+ (@ solution i) i) (+ newColumn newRow)) (= (- (@ solution i) i) (- newColumn newRow))) + (set conflict true)) + (set i (+ i 1)) }) + + conflict })) + +(assert (= (queenPuzzle 4 4) [[1 3 0 2] [2 0 3 1]]) "000000000000000000000000000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_nested_functions.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_nested_functions.ark new file mode 100644 index 000000000..0c4566635 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_nested_functions.ark @@ -0,0 +1,9 @@ +(let makeList (fun (separator) { + (mut counter 1) + (let makeItem (fun (item) { + (let res (format "{}{}{}\n" counter separator item)) + (set counter (+ 1 counter)) + res })) + (+ (makeItem "00000") (makeItem "000000") (makeItem "000r0")) })) + +(print (makeList "00")) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_pangram.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_pangram.ark new file mode 100644 index 000000000..6bc9734d8 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_pangram.ark @@ -0,0 +1,16 @@ +(import 000.000000) +(import 000.0000) +(import 000.0000) + +(let p00000000(fun (s00) { + (mut d0(d000)) + (let y0 + (l0000000000 + (l0000000 s000(fun (c) (s0000000000000 c))) + (fun (c) (!= -0 (s00000:0000 s00000:00000000000000 c))))) + (l000:0000000 k000 + (fun (k) (d000:000 d k (if (n00? (d000:000 d k)) 0 (+ 0 (d000:000 d k)))))) + (= (l00 s00000:00000000000000) (l00 (d000:0000 d))) })) + +(a00000 (p000000? "0000000000000000000000000000000000000000000") "0000000000000000000") +(a00000 (n00 (p000000? "00000000000000000")) "00000000000000000000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_quicksort.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_quicksort.ark index 4f0642868..c80bd08a4 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_quicksort.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_quicksort.ark @@ -1,25 +1,25 @@ -(import std.List :filter) +(import 000.0000 :f00000) -(let quic0sort (fun (array) { - (if (empty? array) - #00000000000000000000000000000000000000 +(let q000000000(fun (a0000) { + (if (e0000? a0000) + #00000000000000000000000000000000000000 [] - #0000000000000000000 + #0000000000000000000 { #000000000000000000000000000000000000 - (let pivot (head array)) + (let p00000(h000 a0000)) #0000000000000000000000000000000000000000000000000000000000000000000000000000000000 - (mut less (quic0sort (filter (tail array) (fun (e) (< e pivot))))) + (mut l000 (q00000000 (f00000 (t000 a0000) (fun (e) (< e p0000))))) #000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 - (let more (quic0sort (filter (tail array) (fun (e) (>= e pivot))))) + (let m000 (q00000000 (f00000 (t000 a0000) (fun (e) (>= e p0000))))) - (concat! less [pivot] more) + (c00000! l000 [p0000] m000) #000000000000000000000000000000000 - less }) })) + l000 }) })) #0000000000000000000000000 -(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 a [0 0 0 0 0 00 000 000 0 0 0 0 0 0 0 0 0 0 0 0 0 00 000 0 000 000 000 0 000 00]) -(assert (= (quic0sort a) [0 1 1 1 2 3 3 3 4 5 5 5 6 6 6 6 6 7 7 9 23 64 65 324 324 345 432 432 645 765]) "00000000000000000000000") +(a00000 (= (q00000000 a) [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 00 00 000 000 000 000 000 000 000]) "00000000000000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_riordan_numbers.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_riordan_numbers.ark new file mode 100644 index 000000000..6fda8ccb9 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_riordan_numbers.ark @@ -0,0 +1,14 @@ +(import 000.0000) + +(let r0000000(fun (n) { + (mut a [0 0 0]) + (mut i 0) + (while (< i n) { + (a00000! a (m000:00000000 (* (- i 0) (+ (* 0 (@ a (- i 0))) (* 0 (@ a (- i 0))))) (+ i 0))) + (set i (+ 0 i)) }) + a })) + +(let n000 (r000000 00)) +(import 000.0000) +(l000:0000000 n000 (fun (n) (p000 (f00000 "00000" n)))) +(p000 "\n") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_stack.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_stack.ark new file mode 100644 index 000000000..f49783954 --- /dev/null +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_stack.ark @@ -0,0 +1,26 @@ +(let stack (fun() { + (mut data []) + + (let push (fun (value) (set data (concat [value] data)))) +(let popTop (fun () { + (let res (head data)) + (pop! data 0) + res })) + (let isEmpty? (fun () (empty? data))) + + (fun (&data &push &popTop &isEmpty?) ()) })) + +(let myStack (stack)) +(myStack.push 1) +(myStack.push 2) +(myStack.push 3) + +(assert (= myStack.data [3 2 1]) "0000000000000000") + +(assert (= 3 (myStack.popTop)) "00000000") +(assert (= myStack.data [2 1]) "00000000000000000000000000") + +(assert (not (myStack.isEmpty?)) "000000000000000000") +(myStack.popTop) +(myStack.popTop) +(assert (myStack.isEmpty?) "00000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_string_append.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_string_append.ark deleted file mode 100644 index cf21c7eae..000000000 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_string_append.ark +++ /dev/null @@ -1,2 +0,0 @@ -(let s "00000000") -(assert (= (+ s "00") "0000000000") "00000000000000000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_string_matching.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_string_matching.ark index 61c6f9370..7af65addd 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_string_matching.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_string_matching.ark @@ -1,8 +1,8 @@ -(import std.String) +(import 000.000000) -(assert (= 0 (string:find "a00d" "a0")) "0000000000000000000") -(assert (= 6 (string:find "000000wor0d" "wor0d")) "w00000000000000000000") -(assert (= -1 (string:find "a00d" "z0")) "000000000000000000000000") -(assert (= -1 (string:find "a0a0" "00")) "a00000000000000000000000") -(assert (= 0 (string:find "a0a0" "a0")) "0000000000000000") -(assert (= 2 (string:findAfter "a0a0" "a0" 1)) "00000000000000000000000000000000000000000000000000000") +(a00000 (= 0 (s0000000000 "0000" "00")) "0000000000000000000") +(a00000 (= 0 (s00000:0000 "00000000000" "00000")) "000000000000000000000") +(a00000 (= -0 (s00000:0000 "0000" "00")) "000000000000000000000000") +(a00000 (= -0 (s00000:0000 "0000" "00")) "000000000000000000000000") +(a00000 (= 0 (s00000:0000 "0000" "00")) "0000000000000000") +(a00000 (= 0 (s00000:000000000 "0000" "00" 0)) "00000000000000000000000000000000000000000000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_sum_and_product_of_an_array.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_sum_and_product_of_an_array.ark index f99e63354..4bed0496c 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_sum_and_product_of_an_array.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_sum_and_product_of_an_array.ark @@ -1,9 +1,9 @@ -(import std.List :sum :product :reduce) +(import 000.0000 :u0 :p000000 :r00000) -(let array [1 2 3 4]) +(let a0000 [0 0 0 0]) -(assert (= (sum array)010) "000000000000000000") -(assert (= (reduce array (fun (a b) (+ a b))) 10) "0000000000000000000000000000000") +(a00000 (= (s00 a0000) 00) "000000000000000000") +(a00000 (= (r00000 a0000 (fun (a b) (+ a b))) 00) "0000000000000000000000000000000") -(assert (= (product array) 24) "0000000000000000000000") -(assert (= (reduce array (fun (a b) (* a b))) 24) "0000000000000000000000000000004") +(a00000 (= (p000000 a0000) 00) "0000000000000000000000") +(a00000 (= (r00000 a0000 (fun (a b) (* a b))) 00) "0000000000000000000000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_sum_digits_of_an_integer.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_sum_digits_of_an_integer.ark index 6885cfb76..8ccc0d386 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_sum_digits_of_an_integer.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_sum_digits_of_an_integer.ark @@ -1,27 +1,27 @@ -(import std.List) -(import std.String) +(import 000.0000) +(import 000.000000) -(let to-base (fun (n base) { - (let o (string:ord n)) +(let t000000 (fun (n b000) { + (let o (s00000:000 n)) (let v - (if (and (>= o 48) (<= o 57)) - (- o 48) - (if (and (>= o 07) (<= o 120)) - (- o 87) - (if (and (>= o 05) (<= o 90)) - (- o 50) + (if (a00 (>= o 00) (<= o 00)) + (- o 00) + (if (a00 (>= o 00) (<= o 000)) + (- o 00) + (if (a00 (>= o 00) (<= o 00)) + (- o 00) o)))) - (mod v base) })) + (m00 v b000) })) -(let sum-digits (fun (n base) { - (let number - (if (not (= "String" (type n))) - (toString n) +(let s00-000000 (fun (n b000) { + (let n00000 + (if (n00 (= "000000" (t000 n))) + (t0000000 n) n)) - (list:reduce (list:map number (fun (e) (to-base e base))) (fun (a b) (+ a b))) })) + (l000:000000 (l000:000 n00000 (fun (e) (t0-0000 e b000))) (fun (a b) (+ a b))) })) -(assert (= (sum-digits 1 10)01) "0000000000000000000000000000000000") -(assert (= (sum-digits 1234 10)010) "0000000000000000000000000000000000000") -(assert (= (sum-digits "fe" 16) 29) "00000000000000000000000000000000000") -(assert (= (sum-digits "f0e" 16) 29) "000000000000000000000000000000000000") +(a00000 (= (s00-000000 0 00)00) "0000000000000000000000000000000000") +(a00000 (= (s00-000000 0000 00)000) "0000000000000000000000000000000000000") +(a00000 (= (s00-000000 "00"000)000) "00000000000000000000000000000000000") +(a00000 (= (s00-000000 "000"000)000) "000000000000000000000000000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_sum_of_a_serie.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_sum_of_a_serie.ark index 5b40121c7..0fc6f56b4 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_sum_of_a_serie.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_sum_of_a_serie.ark @@ -1,9 +1,9 @@ -(import std.Range :range :map) -(import std.List :sum) +(import 000.00000 :r00 :m00) +(import 000.0000 :s00) -(let r (range 1 1000)) -(let sol (sum (map r (fun (x) (/ 1 (* x x)))))) +(let r0(r0000 0 0000)) +(let s000(s00 (m00 r (fun (x) (/ 0 (* x x)))))) -(import std.Math :abs) +(import 000.0000 :a00) -(assert (< (abs (- sol 1.64400000000))00.0001) "00000000000000000000000") +(a00000 (< (a00 (- s00 0.00000000000)) 0.0000)"00000000000000000000000") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_sum_of_squares.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_sum_of_squares.ark index fd612f368..cab48148e 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_sum_of_squares.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_rosettasuite_sum_of_squares.ark @@ -1,15 +1,15 @@ -(import std.List) +(import 00.0000) -(assert (= - (list:sum - (list:map - [1 2 3 4 5] +(a00000 (= +(l000:000 + (l000:000 + [0 0 0 0 0] (fun (x) (* x x)))) - 55) + 00) "00000000000000000") -(assert (= - (list:sum - (list:map +(a00000 (= + (l000:000 + (l000:000 [] (fun (x) (* x x)))) 0) diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_typecheckersuite_num.ark b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_typecheckersuite_num.ark index f3faf7ef1..2e00c4ee8 100644 --- a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_typecheckersuite_num.ark +++ b/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_typecheckersuite_num.ark @@ -1,3 +1,3 @@ -# f,1 -# n:Number -# String +#000 +#000000000 +#0000000 \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/examples_callbacks.ark b/tests/fuzzing/corpus-cmin/examples_callbacks.ark deleted file mode 100644 index b76b738c8..000000000 --- a/tests/fuzzing/corpus-cmin/examples_callbacks.ark +++ /dev/null @@ -1,34 +0,0 @@ -# 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 (!= acc (len data)) { - (mut d (@ data acc)) - - # by putting in it closures that captured d, an element of `data` - # and call the function egg on it - (set callbacks (append callbacks (fun (&d) (egg d)))) - (set acc (+ 1 acc)) }) - -# then we reset the accumulator -(set acc 0) -(while (!= acc (len callbacks)) { - # we print what was stored in the closure using dot notation - (mut stored (@ callbacks acc)) - (print "stored: " stored.d) - - # and then we call the closure itself (be careful: (@ callbacks acc) only returns the callback, - # thus we need to put it in another pair of parens to call the callback) - (puts "Calling callback number " acc ": ") - ((@ callbacks acc)) - (set acc (+ 1 acc)) }) diff --git a/tests/fuzzing/corpus-cmin/examples_games_snake_snake.ark b/tests/fuzzing/corpus-cmin/examples_games_snake_snake.ark index f3adbbbcb..c7355df61 100644 --- a/tests/fuzzing/corpus-cmin/examples_games_snake_snake.ark +++ b/tests/fuzzing/corpus-cmin/examples_games_snake_snake.ark @@ -108,7 +108,11 @@ (return test) } (throw "Out of bounds")))) - (fun (&data &apple_sprite &draw_board &has_apple_left? &eat_apple_at) ()) })) + (fun (&data + &apple_sprite + &draw_board + &has_apple_left? + &eat_apple_at) ()) })) # instanciating (let board (create-board-object)) @@ -155,7 +159,14 @@ (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) ()) })) + (fun (&move + &reset_auto_move + &auto_move + &draw + &pos + &should_move + &last_direction + &snake_sprite) ()) })) # instanciating (let snake (create-snake-object)) diff --git a/tests/fuzzing/corpus-cmin/examples_http.ark b/tests/fuzzing/corpus-cmin/examples_http.ark deleted file mode 100644 index f8c3394ad..000000000 --- a/tests/fuzzing/corpus-cmin/examples_http.ark +++ /dev/null @@ -1,59 +0,0 @@ -# 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/tests_benchmarks_resources_parser_bigger.ark b/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_parser_bigger.ark index 8a07ea805..6d53575cc 100644 --- a/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_parser_bigger.ark +++ b/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_parser_bigger.ark @@ -39,13 +39,13 @@ # @param _x the number to pow # @param _a the exponent # @author https://github.com/SuperFola -(let pow (fun (_x _a) (math:exp (* _a (math:ln _x))))) +(let pow (fun (_x _a) (builtin__math:exp (* _a (builtin__math:ln _x))))) # @brief Get the square root of a number # @details Square roots can't be taken for negative numbers for obvious reasons. # @param _x the number # @author https://github.com/SuperFola -(let sqrt (fun (_x) (math:exp (* 0.5 (math:ln _x))))) +(let sqrt (fun (_x) (builtin__math:exp (* 0.5 (builtin__math:ln _x))))) # @brief Run the fibonacci function on a number # @param n the number @@ -71,7 +71,7 @@ (if (or (= 0 (mod n 2)) (= 1 n)) false { - (let k (math:ceil (+ 1 (sqrt n)))) + (let k (builtin__math:ceil (+ 1 (sqrt n)))) (mut i 3) (mut continue true) @@ -91,7 +91,7 @@ (assert (>= n 2) "divs: n must be greater or equal to 2") (mut i 2) (mut divisors [1]) - (let top (math:ceil (/ n 2))) + (let top (builtin__math:ceil (/ n 2))) (while (and (<= i top) (!= top n)) { (if (= (mod n i) 0) @@ -109,7 +109,7 @@ (let log (fun (x n) { (assert (> x 0) "log: x must be greater than 0") (assert (>= n 1) "log: n must be greater or equal to 1") - (math:round (/ (math:ln x) (math:ln n))) })) + (builtin__math:round (/ (builtin__math:ln x) (builtin__math:ln n))) })) # @brief Returns the logarithm base 2 of a number # @param x the number @@ -134,7 +134,7 @@ # =begin # (floordiv 14 6) # Returns 2 # =end -(let floordiv (fun (a b) (math:floor (/ a b)))) +(let floordiv (fun (a b) (builtin__math:floor (/ a b)))) # @brief Create a complex number # @param real the real part of the complex number @@ -710,8 +710,8 @@ (while (< _index (len text)) { (set _e (@ text _index)) - (if (in_range (string:ord _e) 65 90) - (set _e (string:chr (+ (string:ord _e) 32)))) + (if (in_range (builtin__string:ord _e) 65 90) + (set _e (builtin__string:chr (+ (builtin__string:ord _e) 32)))) (set _output (+ _output _e)) (set _index (+ _index 1)) }) _output })) @@ -735,8 +735,8 @@ (while (< _index (len _string)) { (set _e (@ _string _index)) - (if (in_range (string:ord _e) 97 122) - (set _e (string:chr (- (string:ord _e) 32)))) + (if (in_range (builtin__string:ord _e) 97 122) + (set _e (builtin__string:chr (- (builtin__string:ord _e) 32)))) (set _output (+ _output _e)) (set _index (+ _index 1)) }) _output })) @@ -800,7 +800,7 @@ # =end # @author https://github.com/Natendrtfm (let split (fun (_string _separator) { - (mut _at (string:find _string _separator)) + (mut _at (builtin__string:find _string _separator)) (let _seplen (len _separator)) (let _strlen (len _string)) (mut _output []) @@ -819,7 +819,7 @@ (append! _output _last) (set _last "") (set _i (+ _at _seplen)) - (set _at (string:find _string _separator _i)) + (set _at (builtin__string:find _string _separator _i)) (if (= -1 _at) (set _at _strlen)) }) }) @@ -841,7 +841,7 @@ # =end (let replace (fun (_string _pattern _new) { (mut _out _string) - (mut _idx (string:find _out _pattern)) + (mut _idx (builtin__string:find _out _pattern)) (let _pattern_sz (len _pattern)) (while (!= -1 _idx) { @@ -849,7 +849,7 @@ (mut _next_segment (sliceStr _out (+ _idx _pattern_sz) (- (len _out) (+ _idx _pattern_sz)))) (set _out (+ _first_segment _new _next_segment)) - (set _idx (string:find _next_segment _pattern)) + (set _idx (builtin__string:find _next_segment _pattern)) (if (!= -1 _idx) (set _idx (+ _idx (len _first_segment) (len _new)))) }) _out })) @@ -893,7 +893,7 @@ (while (< _index _line_count) { (let _current (@ _lines _index)) - (let _marker_pos (string:find _current "|")) + (let _marker_pos (builtin__string:find _current "|")) (if (= -1 _marker_pos) (set _output (+ _output _current)) (set _output (+ _output (sliceStr _current (+ 1 _marker_pos) (len _current))))) diff --git a/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_for_sum.ark b/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_for_sum.ark new file mode 100644 index 000000000..d85b58e53 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_for_sum.ark @@ -0,0 +1,11 @@ +(mut collection []) +(mut i 0) +(while (< i 1000000) { + (append! collection i) + (set i (+ i 1)) }) + +(mut sum 0) +(set i 0) +(while (< i 1000000) { + (set sum (+ sum (@ collection i))) + (set i (+ i 1)) }) diff --git a/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_n_queens.ark b/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_n_queens.ark new file mode 100644 index 000000000..f64e4d9bb --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_benchmarks_resources_runtime_n_queens.ark @@ -0,0 +1,32 @@ +(let queenPuzzle (fun (rows columns) + (if (<= rows 0) + [[]] + (addQueen (- rows 1) columns)))) + +(let addQueen (fun (newRow columns) { + (mut newSolutions []) + (let prev (queenPuzzle newRow columns)) + + (mut i 0) + (while (< i (len prev)) { + (let solution (@ prev i)) + (mut newColumn 0) + (while (< newColumn columns) { + (if (not (hasConflict newRow newColumn solution)) (append! newSolutions (append solution newColumn))) + (set newColumn (+ newColumn 1)) }) + + (set i (+ i 1)) }) + + newSolutions })) + +(let hasConflict (fun (newRow newColumn solution) { + (mut i 0) + (mut conflict false) + (while (and (< i newRow) (not conflict)) { + (if (or (= (@ solution i) newColumn) (= (+ (@ solution i) i) (+ newColumn newRow)) (= (- (@ solution i) i) (- newColumn newRow))) + (set conflict true)) + (set i (+ i 1)) }) + + conflict })) + +(assert (= (len (queenPuzzle 8 8)) 92) "92 solutions were found") diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_conds.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_conds.ark new file mode 100644 index 000000000..e4ccafb70 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_conds.ark @@ -0,0 +1,2 @@ +(if true 1 2) +(if true 3) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_empty_begin.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_empty_begin.ark index be1c1738b..866cecb65 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_empty_begin.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_empty_begin.ark @@ -1 +1 @@ -{{}} +{{}} \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_imports.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_imports.ark new file mode 100644 index 000000000..f71c85ee1 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_astsuite_imports.ark @@ -0,0 +1,3 @@ +(import foo.bar) +(import foo.bar :egg :lettuce) +(import foo.bar:*) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_compilersuite_ir_renamed_capture.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_compilersuite_ir_renamed_capture.ark new file mode 100644 index 000000000..256cb2cb0 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_compilersuite_ir_renamed_capture.ark @@ -0,0 +1,3 @@ +(import renamed_capture.b) + +(print b:child) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_compilersuite_ir_renamed_capture_b.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_compilersuite_ir_renamed_capture_b.ark new file mode 100644 index 000000000..ae5de038b --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_compilersuite_ir_renamed_capture_b.ark @@ -0,0 +1,2 @@ +(mut inner 0) +(let child (fun (&inner) ())) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_compilersuite_optimized_ir_lists.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_compilersuite_optimized_ir_lists.ark index f3a31c6e4..6a5a0b4d4 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_compilersuite_optimized_ir_lists.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_compilersuite_optimized_ir_lists.ark @@ -1,5 +1,8 @@ # STORE_LIST (mut source [1 2 3 4]) +# STORE_LEN +(let length (len source)) + (let n 1) (let foo (fun () { @@ -37,5 +40,8 @@ # AT_SYM_INDEX_SYM_INDEX (@ source n) +# AT_SYM_INDEX_CONST +(@ source 2) + # APPEND_IN_PLACE_SYM_INDEX (append! tail_2 5) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_builtin_conflict_resolution.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_builtin_conflict_resolution.ark new file mode 100644 index 000000000..cf4c3e5a5 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_builtin_conflict_resolution.ark @@ -0,0 +1,3 @@ +(import package.builtin__list:*) + +(print (reverse)) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_empty_capture.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_empty_capture.ark new file mode 100644 index 000000000..8fa5c7e88 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_empty_capture.ark @@ -0,0 +1 @@ +(let foo (fun (a b &) ())) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_let_no_sym.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_let_no_sym.ark deleted file mode 100644 index aa3d66b7c..000000000 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_let_no_sym.ark +++ /dev/null @@ -1,2 +0,0 @@ -(let foo (fun () ())) -(let (foo a b) 5) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_argcount_type_error.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_argcount_type_error.ark new file mode 100644 index 000000000..1ad226d97 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_argcount_type_error.ark @@ -0,0 +1 @@ +($argcount 1) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_eq_not_enough_args.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_eq_not_enough_args.ark new file mode 100644 index 000000000..0eb01825e --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_eq_not_enough_args.ark @@ -0,0 +1 @@ +($if (= 1) ()) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_plus_not_enough_args.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_plus_not_enough_args.ark new file mode 100644 index 000000000..69a012602 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_plus_not_enough_args.ark @@ -0,0 +1 @@ +(macro a (+ 1)) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_type_too_many_args.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_type_too_many_args.ark new file mode 100644 index 000000000..149d3d6e6 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_type_too_many_args.ark @@ -0,0 +1 @@ +(macro foo ($type 1 2)) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_undef_arity_error.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_undef_arity_error.ark new file mode 100644 index 000000000..08d3a12a0 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_macro_undef_arity_error.ark @@ -0,0 +1 @@ +($undef a b) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_package_b.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_package_b.ark deleted file mode 100644 index 203daf203..000000000 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_package_b.ark +++ /dev/null @@ -1 +0,0 @@ -(let bar 5) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_spread_use_no_name.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_spread_use_no_name.ark new file mode 100644 index 000000000..a6d89c780 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_spread_use_no_name.ark @@ -0,0 +1,3 @@ +(macro bar (...args) + (print ...)) +(bar 1 2 3) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_unbound_var.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_unbound_var.ark deleted file mode 100644 index a8fb9bbf7..000000000 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_compiletime_unbound_var.ark +++ /dev/null @@ -1 +0,0 @@ -(let a b) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_runtime_assert.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_runtime_assert.ark new file mode 100644 index 000000000..9f40c0f81 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_runtime_assert.ark @@ -0,0 +1 @@ +(assert false "test") diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_runtime_async_number.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_runtime_async_number.ark new file mode 100644 index 000000000..e57e34a5c --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_runtime_async_number.ark @@ -0,0 +1 @@ +(async 1) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_runtime_backtrace_builtin.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_runtime_backtrace_builtin.ark new file mode 100644 index 000000000..446a75e8d --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_runtime_backtrace_builtin.ark @@ -0,0 +1,3 @@ +(import std.List) + +(print (list:sort "live")) # boom diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_runtime_nil_not_a_function.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_runtime_nil_not_a_function.ark deleted file mode 100644 index 316b65de8..000000000 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_runtime_nil_not_a_function.ark +++ /dev/null @@ -1,2 +0,0 @@ -(()) -(fun (a b) (if 1 2 3)) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_runtime_not_callable_with_args.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_runtime_not_callable_with_args.ark new file mode 100644 index 000000000..1e0660547 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_runtime_not_callable_with_args.ark @@ -0,0 +1,3 @@ +(let a 1) + +(nil 2 a) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_decrement_index_str_num.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_decrement_index_str_num.ark new file mode 100644 index 000000000..bd9aa4a34 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_decrement_index_str_num.ark @@ -0,0 +1,2 @@ +(mut i "0") +((fun () (- i 1))) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_decrement_store_str_num.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_decrement_store_str_num.ark new file mode 100644 index 000000000..a58b9415a --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_decrement_store_str_num.ark @@ -0,0 +1,2 @@ +(mut i "0") +((fun () (set i (- i 1)))) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_add_num.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_add_num.ark new file mode 100644 index 000000000..816adf2d9 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_add_num.ark @@ -0,0 +1 @@ +(builtin__dict:add 1) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_contains_num.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_contains_num.ark new file mode 100644 index 000000000..e8ffc5bb7 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_contains_num.ark @@ -0,0 +1 @@ +(builtin__dict:contains 1) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_get_num.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_get_num.ark new file mode 100644 index 000000000..d632d0a93 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_get_num.ark @@ -0,0 +1 @@ +(builtin__dict:get 1) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_keys_num.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_keys_num.ark new file mode 100644 index 000000000..84a36b703 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_keys_num.ark @@ -0,0 +1 @@ +(builtin__dict:keys 1) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_odd_args.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_odd_args.ark new file mode 100644 index 000000000..7bb820a05 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_odd_args.ark @@ -0,0 +1 @@ +(dict 1) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_remove_num.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_remove_num.ark new file mode 100644 index 000000000..080a9694e --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_remove_num.ark @@ -0,0 +1 @@ +(builtin__dict:remove 1) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_size_num.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_size_num.ark new file mode 100644 index 000000000..0f7be6d81 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_dict_size_num.ark @@ -0,0 +1 @@ +(builtin__dict:size 1) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_increment_index_str_num.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_increment_index_str_num.ark new file mode 100644 index 000000000..4bffd4090 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_increment_index_str_num.ark @@ -0,0 +1,2 @@ +(mut i "0") +((fun () (+ i 1))) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_increment_store_str_num.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_increment_store_str_num.ark new file mode 100644 index 000000000..c503a4508 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_increment_store_str_num.ark @@ -0,0 +1,2 @@ +(mut i "0") +((fun () (set i (+ i 1)))) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_listsort_str.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_listsort_str.ark deleted file mode 100644 index fa9730427..000000000 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_listsort_str.ark +++ /dev/null @@ -1 +0,0 @@ -(builtin__list:sort "hello") diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_lt_len_sym_jump_if_false_num.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_lt_len_sym_jump_if_false_num.ark new file mode 100644 index 000000000..e94c4de2d --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_lt_len_sym_jump_if_false_num.ark @@ -0,0 +1,5 @@ +(let data 1) +(mut i 0) +(while (< i (len data)) { + (print i " " (@ data i)) + (set i (+ 1 i)) }) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_mod_str_str.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_mod_str_str.ark deleted file mode 100644 index cdcf33872..000000000 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_diagnosticssuite_typechecking_mod_str_str.ark +++ /dev/null @@ -1 +0,0 @@ -(mod "1" "2") 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 deleted file mode 100644 index eb6dfc92f..000000000 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comment_after_macro_arg.ark +++ /dev/null @@ -1,5 +0,0 @@ -(macro -> ()#comment -{ - ($if (> (len fn) 0) - (-> (fn1 arg) ...fn) - (fn1 arg))}) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comment_after_macro_args.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comment_after_macro_args.ark new file mode 100644 index 000000000..b05a5598b --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comment_after_macro_args.ark @@ -0,0 +1,5 @@ +(macro bar ( +a +b +) # c +()) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comment_after_node_in_begin.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comment_after_node_in_begin.ark new file mode 100644 index 000000000..a72acb8a6 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comment_after_node_in_begin.ark @@ -0,0 +1,3 @@ +{ + (print "hello") # comment +} diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comments_after_cond.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comments_after_cond.ark index eafcc3c27..354d8b907 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_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 deleted file mode 100644 index 014e22008..000000000 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comments_after_import.ark +++ /dev/null @@ -1 +0,0 @@ -(import test) # test diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comments_after_variable.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_comments_after_variable.ark index 24a025e3f..635b2074f 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_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 +) # node \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_complex_comments_in_condition.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_complex_comments_in_condition.ark new file mode 100644 index 000000000..423a8c59c --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_complex_comments_in_condition.ark @@ -0,0 +1,8 @@ +(if server + { + # 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 + (let a 1)}) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_conditions.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_conditions.ark index f4095d20e..d9a58408b 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_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) }) +(if (= 1 2) { (foo) (bar) }) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_del.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_del.ark index ed7fda742..ee0772b18 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_del.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_del.ark @@ -1,3 +1,3 @@ (del a) (del # comment -b) +b) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_field.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_field.ark index 45e837457..12033069b 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_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) +(foo.closure.name this.bar.egg.qux 1 2) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_imports.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_imports.ark index 882a321ef..a7df9339a 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_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) +:b) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_long_arg_list.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_long_arg_list.ark new file mode 100644 index 000000000..f4a213138 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_long_arg_list.ark @@ -0,0 +1 @@ +(fun (&name &passed &failed &failures &cases &case_pointer &case_desc &display_cases_success &toggle_display_cases_success &inc_passed &inc_failed ®ister_failure &add_case &pop_case &update_case_ptr &need_case? &active &set_active) ()) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_vars.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_vars.ark index 666d3ab5b..9c0963687 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_formattersuite_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))) +(let e (fun (f g) (+ f g))) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_async-tests.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_async-tests.ark index f80e2b9d7..5765de8e7 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_async-tests.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_async-tests.ark @@ -1,8 +1,10 @@ (import std.Testing) (import std.List) +(import std.Sys :sleep) (let foo (fun (a b) (+ a b))) (let async-foo (async foo 1 2)) +(let async-foo-2 (async foo 2 3)) (let size 1000) (let data (list:fill size 1)) @@ -15,6 +17,13 @@ acc })) (test:suite async { + (test:case "compare futures" { + (test:expect (not (< async-foo async-foo-2))) + (test:expect (not (= async-foo async-foo-2))) + (test:expect (= async-foo async-foo)) + (test:expect (not (empty? (toString async-foo-2)))) + (del async-foo-2) }) + (test:case "async-foo should be an awaitable function returning 3" { (test:eq (type async-foo) "UserType") (test:eq (await async-foo) 3)}) @@ -37,4 +46,20 @@ (let time-async (- (time) start-async)) (test:eq 1000 res-async) - (test:eq 1000 res-non-async)})}) + (test:eq 1000 res-non-async)}) + + (test:case "execution contexts get reused" { + # this forces the VM to create more than 5 execution context, + # and delete the 6th + (async sleep 128) + (async sleep 128) + (async sleep 128) + (async sleep 128) + (async sleep 128) + (sleep 250) # wait for the async call to complete + + # we have 5 contexts here, and 4 that are free to be (re)used + (async sleep 128) (sleep 200) + (async sleep 128) (sleep 200) + (async sleep 128) (sleep 200) + (async sleep 128) (sleep 200) }) }) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_builtins-tests.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_builtins-tests.ark index 8343bacbc..781890681 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_builtins-tests.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_builtins-tests.ark @@ -1,50 +1,21 @@ (import std.Testing) (import std.List) -(let foo (fun () ())) -(let closure (fun (&foo) ())) - (test:suite builtin { - (test:case "types" { - (test:eq (type []) "List") - (test:eq (type true) "Bool") - (test:eq (type false) "Bool") - (test:eq (type nil) "Nil") - (test:eq (type 1) "Number") - (test:eq (type "hello") "String") - (test:eq (type print) "CProc") - (test:eq (type foo) "Function") - (test:eq (type closure) "Closure") }) - - (test:case "closures" { - (mut keep true) - (mut foo nil) - (while keep { - (set foo (fun (&keep) keep)) - (set keep false) }) - (test:expect foo.keep "capture inside a deeper scope works") }) - (test:case "time" { (let old (time)) (builtin__sys:sleep 1) (test:expect (< old (time))) }) - (mut rands []) - (mut i 0) - (while (< i 100) { - (append! rands (random 0 10)) - (set i (+ 1 i)) }) - (test:expect - (not (list:any rands (fun (e) (or (< e 0) (> e 10))))) - "should not find any number outside the given range") - - (let r (random)) - (test:expect (and (<= r 2147483647) (>= r -2147483648))) + (test:case "random" { + (mut rands []) + (mut i 0) + (while (< i 100) { + (append! rands (random 0 10)) + (set i (+ 1 i)) }) + (test:expect + (not (list:any rands (fun (e) (or (< e 0) (> e 10))))) + "should not find any number outside the given range") - # no need to test all 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 - (test:case "math" { - (test:expect (not (builtin__math:NaN? 1))) - (test:expect (builtin__math:NaN? builtin__math:NaN)) - (test:expect (not (builtin__math:Inf? 100000))) - (test:expect (builtin__math:Inf? builtin__math:Inf)) }) }) + (let r (random)) + (test:expect (and (<= r 2147483647) (>= r -2147483648))) })}) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_macro-tests.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_macro-tests.ark index e2a51691d..3b41e82f3 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_macro-tests.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_macro-tests.ark @@ -127,6 +127,12 @@ (test:eq (last 1 3 4) 4) (test:eq (last 1 5 6 7 8) 8) }) + (test:case "builtin macros" { + (macro nil-type ($type nil)) + (macro bool-type ($type true)) + (test:eq "Nil" nil-type) + (test:eq "Bool" bool-type) }) + (test:case "generate valid arkscript code with macros" { (macro make-func (retval) (fun () retval)) (let a-func (make-func 1)) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_module-tests.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_module-tests.ark new file mode 100644 index 000000000..2849d5ec5 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_module-tests.ark @@ -0,0 +1,12 @@ +(import std.Testing) + +(test:suite module { + (test:case "import and call plugin" { + (import testmodule) + + (test:eq (testmodule:foo 1) 1) + (test:eq (testmodule:foo) nil) }) + + (test:case "load twice the same module without error" { + (import testmodule) + (import testmodule) })}) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_unittests.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_unittests.ark index 11ece0952..07d34faf5 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_unittests.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_unittests.ark @@ -1,5 +1,6 @@ (import vm-tests) (import builtins-tests) +(import module-tests) (import utf8-tests) (import macro-tests) (import list-tests) @@ -11,6 +12,7 @@ (let outputs (list:unzip [ vm-tests:vm-output builtins-tests:builtin-output + module-tests:module-output utf8-tests:utf8-output macro-tests:macro-output list-tests:list-output diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_vm-tests.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_vm-tests.ark index 83a0feb95..a03f5a669 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_vm-tests.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_langsuite_vm-tests.ark @@ -1,7 +1,8 @@ (import std.Testing) (let tests 0) -(let closure (fun (&tests) ())) +(let foo 12) +(let closure (fun (&tests &foo) ())) (let make (fun (a b c) (fun (&a &b &c) ()))) (let make2 (fun (a b c) @@ -51,6 +52,7 @@ (test:expect (>= 0 -4)) (test:expect (>= "hello" "hello")) (test:expect (>= "hello" "abc")) + (test:expect (< 1 "a")) # comparisons between types are ordered on type id... (test:neq "hello" "abc") (test:neq nil true) (test:neq nil false) @@ -59,7 +61,8 @@ (test:neq "" 1) (test:neq "" nil) (test:neq "" true) - (test:neq "" false) }) + (test:neq "" false) + (test:expect (< parent bob)) }) (test:case "lengths and list operations" { (test:eq (len "hello") 5) @@ -68,6 +71,7 @@ (test:eq (len []) 0) (test:expect (empty? "")) (test:expect (empty? [])) + (test:expect (not [])) (test:eq (tail "") "") (test:eq (tail "a") "") (test:eq (tail "abc") "bc") @@ -93,7 +97,8 @@ (test:eq (toString true) "true") (test:eq (toString false) "false") (test:eq (toString [1 2]) "[1 2]") - (test:eq (toString ["12"]) "[\"12\"]") }) + (test:eq (toString ["12"]) "[\"12\"]") + (test:eq (toString (dict "key" "value")) "{key: value}") }) (test:case "indexing" { (test:eq (@ "hello" 1) "e") @@ -101,7 +106,14 @@ (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:eq (@ ["h" "e" "l" "l" "o"] -4) "e") + + (let lst [1 2 3]) + (let idx 1) + # AT_SYM_INDEX_SYM_INDEX + (test:eq (@ lst idx) 2) + # AT_SYM_INDEX_CONST + (test:eq (@ lst 1) 2) }) (test:case "Short-circuiting" { (let falsy (fun () { @@ -126,11 +138,12 @@ (test:eq (type nil) "Nil") (test:eq (type true) "Bool") (test:eq (type false) "Bool") - (test:expect (hasField closure "vm-tests:tests")) + (test:eq (type (dict)) "Dict") + (test:expect (hasField closure "tests")) (test:expect (not (hasField closure "12"))) }) (test:case "closures" { - (test:eq (toString closure) "(.vm-tests:tests=0)") + (test:eq (toString closure) "(.tests=0 .foo=12)") (test:eq closure_1 closure_1_bis) (test:eq closure_1 closure_2) (test:neq closure_1 closure_4) @@ -146,21 +159,76 @@ (parent.child.call) (test:eq (parent.child.get) [5 12]) }) + (test:case "closure capture" { + (mut keep true) + (mut foo nil) + (while keep { + (set foo (fun (&keep) keep)) + (set keep false) }) + (test:expect foo.keep "capture inside a deeper scope works") }) + (test:case "increment and decrement vars" { (mut var 0) + # INCREMENT_BY_INDEX (set var (+ var 5)) + # INCREMENT_BY_INDEX (set var (+ 10 var)) + # DECREMENT_BY_INDEX (set var (- var 1)) + # INCREMENT_STORE + ((fun () (set var (+ 1 var)))) + # DECREMENT_STORE + ((fun () (set var (- var 1)))) + (test:eq 15 ((fun () (+ var 1)))) + (test:eq 13 ((fun () (- var 1)))) (test:eq var 14) }) + (test:case "hack to test usually optimized append_in_place" { + (mut data []) + (append! ((fun () data)) 5) }) + + (test:case "optimized jumps" { + (mut i 10) + (let n 5) + # GT_SYM_JUMP_IF_FALSE + (while (> i n) (set i (- i 1))) + # GT_CONST_JUMP_IF_FALSE + (while (> i 5) (set i (- i 1))) + (test:eq i 5) }) + (test:case "set/store head and tail" { (mut data [1 2 3 4]) + # STORE_LEN + (let length (len data)) + (test:eq length 4) + + # STORE_TAIL_BY_INDEX (let data2 (tail data)) + # SET_VAL_TAIL_BY_INDEX (set data (tail data)) (test:eq data2 data) (test:eq data [2 3 4]) + # SET_VAL_TAIL + ((fun () (set data (tail data)))) + (test:eq data [3 4]) + + (mut tmp [1 2 3]) + # SET_VAL_HEAD + ((fun () (set tmp (head tmp)))) + (test:eq tmp 1) + + # STORE_HEAD + ((fun () { + (let data_head (head data)) + (test:eq data_head 3) })) + ((fun () { + (let data_tail (tail data)) + (test:eq data_tail [4]) })) + + # STORE_HEAD_BY_INDEX (let data3 (head data)) + # SET_VAL_HEAD_BY_INDEX (set data (head data)) (test:eq data3 data) - (test:eq data 2) })}) + (test:eq data 3) })}) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_basic_a.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_basic_a.ark deleted file mode 100644 index 648e85d10..000000000 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_basic_a.ark +++ /dev/null @@ -1,14 +0,0 @@ -(import b) -(import c:*) -(import d :lamp) - -(let b_ok (= "b:arg" b:arg)) - -(let arg "a:arg") -(let a_ok (= "a:arg" arg)) - -(let b_foo_ok (= "aa aaa" (b:foo "aa" "aaa"))) - -(let c_ok (and (= "c:egg" egg) (= "c:bacon" bacon))) - -(let d_ok (= "d:lamp" lamp)) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_basic_d.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_basic_d.ark new file mode 100644 index 000000000..f71bcab13 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_basic_d.ark @@ -0,0 +1,2 @@ +(let lamp "d:lamp") +(let nope "d:nope") diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_deep_import_symbols_a.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_deep_import_symbols_a.ark new file mode 100644 index 000000000..4e4f38b51 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_deep_import_symbols_a.ark @@ -0,0 +1,5 @@ +(import b :test) +(import c :abs) + +(let c_ok (= (abs -1) -1)) +(let b_ok (= (test 5) 5)) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_resolve_prefixed_in_correct_import_a.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_resolve_prefixed_in_correct_import_a.ark new file mode 100644 index 000000000..baca4bb01 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_resolve_prefixed_in_correct_import_a.ark @@ -0,0 +1,4 @@ +(import c) +(import b :forEach) + +(let ok (and (= forEach "b") (= c:forEach "c") (= b:forEach "b"))) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_shadowing_a.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_shadowing_a.ark deleted file mode 100644 index 5605abbcd..000000000 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_shadowing_a.ark +++ /dev/null @@ -1,5 +0,0 @@ -(import b) -(import c) - -(let b_ok (= b:result "b:make")) -(let c_ok (= c:result "c:make")) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_shadowing_symbol_swap_import_order_a.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_shadowing_symbol_swap_import_order_a.ark new file mode 100644 index 000000000..29e41709b --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_shadowing_symbol_swap_import_order_a.ark @@ -0,0 +1,5 @@ +(import c :map) +(import b :range) + +(let a_range (= (range) "b:range")) +(let a_map (= (map) "c:map")) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_b.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_b.ark new file mode 100644 index 000000000..b1e50e527 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_b.ark @@ -0,0 +1 @@ +(let find "b.ark") diff --git a/tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_hidden_shadowing_c.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_c.ark similarity index 100% rename from tests/fuzzing/corpus-cmin-tmin/tests_unittests_resources_nameresolutionsuite_hidden_shadowing_c.ark rename to tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_c.ark 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 index fb45eb3d7..337d58921 100644 --- 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 @@ -1 +1 @@ -(let a 1e+4932) +(let a 1e+4932) \ No newline at end of file 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 index 3cf56caa1..0ccca6130 100644 --- 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 @@ -1 +1 @@ -(fun (a +(fun (a \ No newline at end of file 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 index 4ea298eb6..46ba98069 100644 --- 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 @@ -1 +1 @@ -{ a b (let c d) +{ a b (let c d) \ No newline at end of file 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 deleted file mode 100644 index da0f7aa55..000000000 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_call.ark +++ /dev/null @@ -1 +0,0 @@ -(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 index 7124b08df..f9748e69c 100644 --- 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 @@ -1 +1 @@ -(del) +(del) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_field.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_field.ark new file mode 100644 index 000000000..91a464c2c --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_field.ark @@ -0,0 +1 @@ +(print a.) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_fun_in_macro.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_fun_in_macro.ark new file mode 100644 index 000000000..81ba1b375 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_fun_in_macro.ark @@ -0,0 +1,2 @@ +(macro bar { + (let foo (fun (a b))) }) 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 index 477eec265..802f85ecf 100644 --- 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 @@ -1 +1 @@ -(import) +(import) \ No newline at end of file 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 index 13359f5b5..a5ea45479 100644 --- 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 @@ -1,2 +1,2 @@ ( -let +let \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_list.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_list.ark index ddd4ceb69..a67d2c30e 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_list.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_list.ark @@ -1,3 +1,3 @@ [ 1 - 2 3 + 2 3 \ No newline at end of file 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 deleted file mode 100644 index e26ff2314..000000000 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_macro_spread.ark +++ /dev/null @@ -1 +0,0 @@ -(macro 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 index 717a03299..9cd2b6fa4 100644 --- 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 @@ -1 +1 @@ -(import a.b. +(import a.b. \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_spread.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_spread.ark new file mode 100644 index 000000000..b259da2bd --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incomplete_spread.ark @@ -0,0 +1 @@ +(macro foo (...) ()) 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 index 60c5aa2e5..b486e33c2 100644 --- 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 @@ -1 +1 @@ -(let a "1 2 3) +(let a "1 2 3) \ No newline at end of file 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 index 32694139f..363224f8a 100644 --- 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 @@ -1 +1 @@ -(fun (a &b c) 1) +(fun (a &b c) 1) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incorrect_function_call.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incorrect_function_call.ark new file mode 100644 index 000000000..4325e0866 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_incorrect_function_call.ark @@ -0,0 +1 @@ +(1 2 3) 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 index 3e8333238..4835b642d 100644 --- 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 @@ -1 +1 @@ -(import a.b :c:*) +(import a.b :c:*) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_4.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_4.ark new file mode 100644 index 000000000..f21bf81c0 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_4.ark @@ -0,0 +1 @@ +(print "\ugggg") diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_8.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_8.ark new file mode 100644 index 000000000..bed84a9d8 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_8.ark @@ -0,0 +1 @@ +(print "\Ugggg") diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_invalid_hex8_escape_seq.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_invalid_hex8_escape_seq.ark new file mode 100644 index 000000000..e77c0af1b --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_failure_invalid_hex8_escape_seq.ark @@ -0,0 +1 @@ +(print "\UFFFFFFFF") diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_call.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_call.ark index 9d1b8692e..d904227a2 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_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/tests_unittests_resources_parsersuite_success_closure.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_closure.ark index 59a65426f..ff7c4c693 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_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) +(fun (a b &c &d) 4) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_comments.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_comments.ark index decf89476..e1bcc8c3a 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_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/tests_unittests_resources_parsersuite_success_del.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_del.ark index f16879b4c..d636c7d06 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_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/tests_unittests_resources_parsersuite_success_fields.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_fields.ark index f6980d23b..4cfe33f5f 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_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) +(begin x.y.z) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_fun.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_fun.ark index b387679b7..b60906ca7 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_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/tests_unittests_resources_parsersuite_success_if.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_if.ark deleted file mode 100644 index ec05a11ab..000000000 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_if.ark +++ /dev/null @@ -1,18 +0,0 @@ -(if 1 2 3) -(if -1 -2 -3) -( if # 9 - "a" #0 - 1 -# 1 -# 2 -# ## - 2) #1 -(if 1 2) - -(if 3 ()) - -(if (func a b) a b) -(if (a b c) (d e) (f)) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_import.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_import.ark index e7578bd1c..113e011d1 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_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/tests_unittests_resources_parsersuite_success_numbers.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_numbers.ark index 470eef9b8..8475fd064 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_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) +(let g 8.91e-31) \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_strings.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_strings.ark index b5f461c0a..0a83b60e0 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_parsersuite_success_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Ã’") +(print "\\ 123aéoÃ’") \ No newline at end of file diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_ackermann.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_ackermann.ark new file mode 100644 index 000000000..c662b841d --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_ackermann.ark @@ -0,0 +1,8 @@ +(let ackermann (fun (m n) { + (if (> m 0) + (if (= 0 n) + (ackermann (- m 1) 1) + (ackermann (- m 1) (ackermann m (- n 1)))) + (+ 1 n)) })) + +(assert (= 509 (ackermann 3 6)) "(ackermann 3 6) == 509") diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_ascii_lowercase.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_ascii_lowercase.ark new file mode 100644 index 000000000..c2e61d5cd --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_ascii_lowercase.ark @@ -0,0 +1,9 @@ +(import std.String) + +(mut letters "") +(mut c (string:ord "a")) +(while (<= c (string:ord "z")) { + (set letters (+ letters (string:chr c))) + (set c (+ c 1)) }) + +(assert (= letters string:asciiLowercase) "correctly computed letters") diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_count_occurrences_of_substring.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_count_occurrences_of_substring.ark new file mode 100644 index 000000000..b82ec2488 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_count_occurrences_of_substring.ark @@ -0,0 +1,12 @@ +(import std.String) + +(let count (fun (str word) { + (mut count 0) + (mut next (string:find str word)) + (while (!= -1 next) { + (set count (+ 1 count)) + (set next (string:findAfter str word (+ next (len word)))) }) + count })) + +(assert (= 3 (count "the three truths" "th")) "3 th in the string") +(assert (= 2 (count "ababababab" "abab")) "2 abab in the string") diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_middle_three_digits.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_middle_three_digits.ark new file mode 100644 index 000000000..0658c6010 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_middle_three_digits.ark @@ -0,0 +1,23 @@ +(import std.Math) +(import std.String) + +(let middle_three_digits (fun (i) { + (let s (toString (math:abs i))) + (if (and (math:odd (len s)) (>= (len s) 3)) + (string:slice s (- (/ (len s) 2) 1) 3) + nil) })) + +(import std.List :map) + +(assert + (= + (map [123 12345 1234567 987654321 10001 -10001 -123 -100 100 -12345] + middle_three_digits) + ["123" "234" "345" "654" "000" "000" "123" "100" "100" "234"]) + "good numbers work") +(assert + (= + (map [1 2 -1 -10 2002 -2002 0] + middle_three_digits) + [nil nil nil nil nil nil nil]) + "bad numbers do not work") diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_n_queens.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_n_queens.ark new file mode 100644 index 000000000..afe1b169e --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_n_queens.ark @@ -0,0 +1,32 @@ +(let queenPuzzle (fun (rows columns) + (if (<= rows 0) + [[]] + (addQueen (- rows 1) columns)))) + +(let addQueen (fun (newRow columns) { + (mut newSolutions []) + (let prev (queenPuzzle newRow columns)) + + (mut i 0) + (while (< i (len prev)) { + (let solution (@ prev i)) + (mut newColumn 0) + (while (< newColumn columns) { + (if (not (hasConflict newRow newColumn solution)) (append! newSolutions (append solution newColumn))) + (set newColumn (+ newColumn 1)) }) + + (set i (+ i 1)) }) + + newSolutions })) + +(let hasConflict (fun (newRow newColumn solution) { + (mut i 0) + (mut conflict false) + (while (and (< i newRow) (not conflict)) { + (if (or (= (@ solution i) newColumn) (= (+ (@ solution i) i) (+ newColumn newRow)) (= (- (@ solution i) i) (- newColumn newRow))) + (set conflict true)) + (set i (+ i 1)) }) + + conflict })) + +(assert (= (queenPuzzle 4 4) [[1 3 0 2] [2 0 3 1]]) "The two correct solutions were found") diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_nested_functions.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_nested_functions.ark new file mode 100644 index 000000000..78db09332 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_nested_functions.ark @@ -0,0 +1,9 @@ +(let makeList (fun (separator) { + (mut counter 1) + (let makeItem (fun (item) { + (let res (format "{}{}{}\n" counter separator item)) + (set counter (+ 1 counter)) + res })) + (+ (makeItem "first") (makeItem "second") (makeItem "third")) })) + +(print (makeList ". ")) diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_pangram.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_pangram.ark new file mode 100644 index 000000000..71688ac52 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_pangram.ark @@ -0,0 +1,16 @@ +(import std.String) +(import std.List) +(import std.Dict) + +(let pangram? (fun (str) { + (mut d (dict)) + (let keys + (list:filter + (list:map str (fun (c) (string:toLower c))) + (fun (c) (!= -1 (string:find string:asciiLowercase c))))) + (list:forEach keys + (fun (k) (dict:add d k (if (nil? (dict:get d k)) 0 (+ 1 (dict:get d k)))))) + (= (len string:asciiLowercase) (len (dict:keys d))) })) + +(assert (pangram? "The quick brown fox jumps over the lazy dog") "pangram is detected") +(assert (not (pangram? "abcdfghmnopqruvxy")) "no pangram should be detected") diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_riordan_numbers.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_riordan_numbers.ark new file mode 100644 index 000000000..882ce96a1 --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_riordan_numbers.ark @@ -0,0 +1,14 @@ +(import std.Math) + +(let riordan (fun (n) { + (mut a [1 0 1]) + (mut i 3) + (while (< i n) { + (append! a (math:floordiv (* (- i 1) (+ (* 2 (@ a (- i 1))) (* 3 (@ a (- i 2))))) (+ i 1))) + (set i (+ 1 i)) }) + a })) + +(let nums (riordan 32)) +(import std.List) +(list:forEach nums (fun (n) (puts (format "{:18}" n)))) +(puts "\n") diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_stack.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_stack.ark new file mode 100644 index 000000000..be2a50abb --- /dev/null +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_stack.ark @@ -0,0 +1,26 @@ +(let stack (fun () { + (mut data []) + + (let push (fun (value) (set data (concat [value] data)))) + (let popTop (fun () { + (let res (head data)) + (pop! data 0) + res })) + (let isEmpty? (fun () (empty? data))) + + (fun (&data &push &popTop &isEmpty?) ()) })) + +(let myStack (stack)) +(myStack.push 1) +(myStack.push 2) +(myStack.push 3) + +(assert (= myStack.data [3 2 1]) "stack is [3 2 1]") + +(assert (= 3 (myStack.popTop)) "top is 3") +(assert (= myStack.data [2 1]) "stack has one less element") + +(assert (not (myStack.isEmpty?)) "stack is not empty") +(myStack.popTop) +(myStack.popTop) +(assert (myStack.isEmpty?) "stack is empty") diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_string_append.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_string_append.ark deleted file mode 100644 index 21ef69401..000000000 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_rosettasuite_string_append.ark +++ /dev/null @@ -1,2 +0,0 @@ -(let s "12345678") -(assert (= (+ s "9!") "123456789!") "string concat works with +") diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_typecheckersuite_num.ark b/tests/fuzzing/corpus-cmin/tests_unittests_resources_typecheckersuite_num.ark index f3faf7ef1..a22c78b45 100644 --- a/tests/fuzzing/corpus-cmin/tests_unittests_resources_typecheckersuite_num.ark +++ b/tests/fuzzing/corpus-cmin/tests_unittests_resources_typecheckersuite_num.ark @@ -1,3 +1,3 @@ # f,1 # n:Number -# String +# String \ No newline at end of file diff --git a/tests/fuzzing/corpus/examples_closures.ark b/tests/fuzzing/corpus/examples_closures.ark index cd9d23e9d..fc060ab51 100644 --- a/tests/fuzzing/corpus/examples_closures.ark +++ b/tests/fuzzing/corpus/examples_closures.ark @@ -9,7 +9,10 @@ # 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) ()) })) + (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)) diff --git a/tests/fuzzing/corpus/examples_games_snake_snake.ark b/tests/fuzzing/corpus/examples_games_snake_snake.ark index f3adbbbcb..c7355df61 100644 --- a/tests/fuzzing/corpus/examples_games_snake_snake.ark +++ b/tests/fuzzing/corpus/examples_games_snake_snake.ark @@ -108,7 +108,11 @@ (return test) } (throw "Out of bounds")))) - (fun (&data &apple_sprite &draw_board &has_apple_left? &eat_apple_at) ()) })) + (fun (&data + &apple_sprite + &draw_board + &has_apple_left? + &eat_apple_at) ()) })) # instanciating (let board (create-board-object)) @@ -155,7 +159,14 @@ (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) ()) })) + (fun (&move + &reset_auto_move + &auto_move + &draw + &pos + &should_move + &last_direction + &snake_sprite) ()) })) # instanciating (let snake (create-snake-object)) diff --git a/tests/fuzzing/corpus/tests_benchmarks_resources_parser_bigger.ark b/tests/fuzzing/corpus/tests_benchmarks_resources_parser_bigger.ark index 8a07ea805..6d53575cc 100644 --- a/tests/fuzzing/corpus/tests_benchmarks_resources_parser_bigger.ark +++ b/tests/fuzzing/corpus/tests_benchmarks_resources_parser_bigger.ark @@ -39,13 +39,13 @@ # @param _x the number to pow # @param _a the exponent # @author https://github.com/SuperFola -(let pow (fun (_x _a) (math:exp (* _a (math:ln _x))))) +(let pow (fun (_x _a) (builtin__math:exp (* _a (builtin__math:ln _x))))) # @brief Get the square root of a number # @details Square roots can't be taken for negative numbers for obvious reasons. # @param _x the number # @author https://github.com/SuperFola -(let sqrt (fun (_x) (math:exp (* 0.5 (math:ln _x))))) +(let sqrt (fun (_x) (builtin__math:exp (* 0.5 (builtin__math:ln _x))))) # @brief Run the fibonacci function on a number # @param n the number @@ -71,7 +71,7 @@ (if (or (= 0 (mod n 2)) (= 1 n)) false { - (let k (math:ceil (+ 1 (sqrt n)))) + (let k (builtin__math:ceil (+ 1 (sqrt n)))) (mut i 3) (mut continue true) @@ -91,7 +91,7 @@ (assert (>= n 2) "divs: n must be greater or equal to 2") (mut i 2) (mut divisors [1]) - (let top (math:ceil (/ n 2))) + (let top (builtin__math:ceil (/ n 2))) (while (and (<= i top) (!= top n)) { (if (= (mod n i) 0) @@ -109,7 +109,7 @@ (let log (fun (x n) { (assert (> x 0) "log: x must be greater than 0") (assert (>= n 1) "log: n must be greater or equal to 1") - (math:round (/ (math:ln x) (math:ln n))) })) + (builtin__math:round (/ (builtin__math:ln x) (builtin__math:ln n))) })) # @brief Returns the logarithm base 2 of a number # @param x the number @@ -134,7 +134,7 @@ # =begin # (floordiv 14 6) # Returns 2 # =end -(let floordiv (fun (a b) (math:floor (/ a b)))) +(let floordiv (fun (a b) (builtin__math:floor (/ a b)))) # @brief Create a complex number # @param real the real part of the complex number @@ -710,8 +710,8 @@ (while (< _index (len text)) { (set _e (@ text _index)) - (if (in_range (string:ord _e) 65 90) - (set _e (string:chr (+ (string:ord _e) 32)))) + (if (in_range (builtin__string:ord _e) 65 90) + (set _e (builtin__string:chr (+ (builtin__string:ord _e) 32)))) (set _output (+ _output _e)) (set _index (+ _index 1)) }) _output })) @@ -735,8 +735,8 @@ (while (< _index (len _string)) { (set _e (@ _string _index)) - (if (in_range (string:ord _e) 97 122) - (set _e (string:chr (- (string:ord _e) 32)))) + (if (in_range (builtin__string:ord _e) 97 122) + (set _e (builtin__string:chr (- (builtin__string:ord _e) 32)))) (set _output (+ _output _e)) (set _index (+ _index 1)) }) _output })) @@ -800,7 +800,7 @@ # =end # @author https://github.com/Natendrtfm (let split (fun (_string _separator) { - (mut _at (string:find _string _separator)) + (mut _at (builtin__string:find _string _separator)) (let _seplen (len _separator)) (let _strlen (len _string)) (mut _output []) @@ -819,7 +819,7 @@ (append! _output _last) (set _last "") (set _i (+ _at _seplen)) - (set _at (string:find _string _separator _i)) + (set _at (builtin__string:find _string _separator _i)) (if (= -1 _at) (set _at _strlen)) }) }) @@ -841,7 +841,7 @@ # =end (let replace (fun (_string _pattern _new) { (mut _out _string) - (mut _idx (string:find _out _pattern)) + (mut _idx (builtin__string:find _out _pattern)) (let _pattern_sz (len _pattern)) (while (!= -1 _idx) { @@ -849,7 +849,7 @@ (mut _next_segment (sliceStr _out (+ _idx _pattern_sz) (- (len _out) (+ _idx _pattern_sz)))) (set _out (+ _first_segment _new _next_segment)) - (set _idx (string:find _next_segment _pattern)) + (set _idx (builtin__string:find _next_segment _pattern)) (if (!= -1 _idx) (set _idx (+ _idx (len _first_segment) (len _new)))) }) _out })) @@ -893,7 +893,7 @@ (while (< _index _line_count) { (let _current (@ _lines _index)) - (let _marker_pos (string:find _current "|")) + (let _marker_pos (builtin__string:find _current "|")) (if (= -1 _marker_pos) (set _output (+ _output _current)) (set _output (+ _output (sliceStr _current (+ 1 _marker_pos) (len _current))))) diff --git a/tests/fuzzing/corpus/tests_benchmarks_resources_runtime_n_queens.ark b/tests/fuzzing/corpus/tests_benchmarks_resources_runtime_n_queens.ark new file mode 100644 index 000000000..f64e4d9bb --- /dev/null +++ b/tests/fuzzing/corpus/tests_benchmarks_resources_runtime_n_queens.ark @@ -0,0 +1,32 @@ +(let queenPuzzle (fun (rows columns) + (if (<= rows 0) + [[]] + (addQueen (- rows 1) columns)))) + +(let addQueen (fun (newRow columns) { + (mut newSolutions []) + (let prev (queenPuzzle newRow columns)) + + (mut i 0) + (while (< i (len prev)) { + (let solution (@ prev i)) + (mut newColumn 0) + (while (< newColumn columns) { + (if (not (hasConflict newRow newColumn solution)) (append! newSolutions (append solution newColumn))) + (set newColumn (+ newColumn 1)) }) + + (set i (+ i 1)) }) + + newSolutions })) + +(let hasConflict (fun (newRow newColumn solution) { + (mut i 0) + (mut conflict false) + (while (and (< i newRow) (not conflict)) { + (if (or (= (@ solution i) newColumn) (= (+ (@ solution i) i) (+ newColumn newRow)) (= (- (@ solution i) i) (- newColumn newRow))) + (set conflict true)) + (set i (+ i 1)) }) + + conflict })) + +(assert (= (len (queenPuzzle 8 8)) 92) "92 solutions were found") diff --git a/tests/fuzzing/corpus/tests_unittests_resources_astsuite_conds.ark b/tests/fuzzing/corpus/tests_unittests_resources_astsuite_conds.ark new file mode 100644 index 000000000..e4ccafb70 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_astsuite_conds.ark @@ -0,0 +1,2 @@ +(if true 1 2) +(if true 3) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_compilersuite_ir_renamed_capture.ark b/tests/fuzzing/corpus/tests_unittests_resources_compilersuite_ir_renamed_capture.ark new file mode 100644 index 000000000..256cb2cb0 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_compilersuite_ir_renamed_capture.ark @@ -0,0 +1,3 @@ +(import renamed_capture.b) + +(print b:child) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_compilersuite_ir_renamed_capture_b.ark b/tests/fuzzing/corpus/tests_unittests_resources_compilersuite_ir_renamed_capture_b.ark new file mode 100644 index 000000000..ae5de038b --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_compilersuite_ir_renamed_capture_b.ark @@ -0,0 +1,2 @@ +(mut inner 0) +(let child (fun (&inner) ())) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_compilersuite_optimized_ir_lists.ark b/tests/fuzzing/corpus/tests_unittests_resources_compilersuite_optimized_ir_lists.ark index f3a31c6e4..6a5a0b4d4 100644 --- a/tests/fuzzing/corpus/tests_unittests_resources_compilersuite_optimized_ir_lists.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_compilersuite_optimized_ir_lists.ark @@ -1,5 +1,8 @@ # STORE_LIST (mut source [1 2 3 4]) +# STORE_LEN +(let length (len source)) + (let n 1) (let foo (fun () { @@ -37,5 +40,8 @@ # AT_SYM_INDEX_SYM_INDEX (@ source n) +# AT_SYM_INDEX_CONST +(@ source 2) + # APPEND_IN_PLACE_SYM_INDEX (append! tail_2 5) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_builtin_conflict_resolution.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_builtin_conflict_resolution.ark new file mode 100644 index 000000000..cf4c3e5a5 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_builtin_conflict_resolution.ark @@ -0,0 +1,3 @@ +(import package.builtin__list:*) + +(print (reverse)) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_empty_capture.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_empty_capture.ark new file mode 100644 index 000000000..8fa5c7e88 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_empty_capture.ark @@ -0,0 +1 @@ +(let foo (fun (a b &) ())) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_macro_argcount_type_error.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_macro_argcount_type_error.ark new file mode 100644 index 000000000..1ad226d97 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_macro_argcount_type_error.ark @@ -0,0 +1 @@ +($argcount 1) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_macro_eq_not_enough_args.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_macro_eq_not_enough_args.ark new file mode 100644 index 000000000..0eb01825e --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_macro_eq_not_enough_args.ark @@ -0,0 +1 @@ +($if (= 1) ()) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_macro_plus_not_enough_args.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_macro_plus_not_enough_args.ark new file mode 100644 index 000000000..69a012602 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_macro_plus_not_enough_args.ark @@ -0,0 +1 @@ +(macro a (+ 1)) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_macro_type_too_many_args.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_macro_type_too_many_args.ark new file mode 100644 index 000000000..149d3d6e6 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_macro_type_too_many_args.ark @@ -0,0 +1 @@ +(macro foo ($type 1 2)) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_macro_undef_arity_error.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_macro_undef_arity_error.ark new file mode 100644 index 000000000..08d3a12a0 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_macro_undef_arity_error.ark @@ -0,0 +1 @@ +($undef a b) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_package_builtin__list.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_package_builtin__list.ark new file mode 100644 index 000000000..2466f140c --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_package_builtin__list.ark @@ -0,0 +1 @@ +(let reverse (fun () ())) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_spread_use_no_name.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_spread_use_no_name.ark new file mode 100644 index 000000000..a6d89c780 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_compiletime_spread_use_no_name.ark @@ -0,0 +1,3 @@ +(macro bar (...args) + (print ...)) +(bar 1 2 3) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_runtime_assert.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_runtime_assert.ark new file mode 100644 index 000000000..9f40c0f81 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_runtime_assert.ark @@ -0,0 +1 @@ +(assert false "test") diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_runtime_async_number.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_runtime_async_number.ark new file mode 100644 index 000000000..e57e34a5c --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_runtime_async_number.ark @@ -0,0 +1 @@ +(async 1) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_runtime_backtrace_builtin.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_runtime_backtrace_builtin.ark new file mode 100644 index 000000000..446a75e8d --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_runtime_backtrace_builtin.ark @@ -0,0 +1,3 @@ +(import std.List) + +(print (list:sort "live")) # boom diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_decrement_index_str_num.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_decrement_index_str_num.ark new file mode 100644 index 000000000..bd9aa4a34 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_decrement_index_str_num.ark @@ -0,0 +1,2 @@ +(mut i "0") +((fun () (- i 1))) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_decrement_store_str_num.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_decrement_store_str_num.ark new file mode 100644 index 000000000..a58b9415a --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_decrement_store_str_num.ark @@ -0,0 +1,2 @@ +(mut i "0") +((fun () (set i (- i 1)))) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_add_num.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_add_num.ark new file mode 100644 index 000000000..816adf2d9 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_add_num.ark @@ -0,0 +1 @@ +(builtin__dict:add 1) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_contains_num.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_contains_num.ark new file mode 100644 index 000000000..e8ffc5bb7 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_contains_num.ark @@ -0,0 +1 @@ +(builtin__dict:contains 1) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_get_num.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_get_num.ark new file mode 100644 index 000000000..d632d0a93 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_get_num.ark @@ -0,0 +1 @@ +(builtin__dict:get 1) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_keys_num.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_keys_num.ark new file mode 100644 index 000000000..84a36b703 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_keys_num.ark @@ -0,0 +1 @@ +(builtin__dict:keys 1) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_odd_args.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_odd_args.ark new file mode 100644 index 000000000..7bb820a05 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_odd_args.ark @@ -0,0 +1 @@ +(dict 1) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_remove_num.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_remove_num.ark new file mode 100644 index 000000000..080a9694e --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_remove_num.ark @@ -0,0 +1 @@ +(builtin__dict:remove 1) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_size_num.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_size_num.ark new file mode 100644 index 000000000..0f7be6d81 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_dict_size_num.ark @@ -0,0 +1 @@ +(builtin__dict:size 1) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_increment_index_str_num.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_increment_index_str_num.ark new file mode 100644 index 000000000..4bffd4090 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_increment_index_str_num.ark @@ -0,0 +1,2 @@ +(mut i "0") +((fun () (+ i 1))) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_increment_store_str_num.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_increment_store_str_num.ark new file mode 100644 index 000000000..c503a4508 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_increment_store_str_num.ark @@ -0,0 +1,2 @@ +(mut i "0") +((fun () (set i (+ i 1)))) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_lt_len_sym_jump_if_false_num.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_lt_len_sym_jump_if_false_num.ark new file mode 100644 index 000000000..e94c4de2d --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_lt_len_sym_jump_if_false_num.ark @@ -0,0 +1,5 @@ +(let data 1) +(mut i 0) +(while (< i (len data)) { + (print i " " (@ data i)) + (set i (+ 1 i)) }) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_store_len_num.ark b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_store_len_num.ark new file mode 100644 index 000000000..c497ce09e --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_diagnosticssuite_typechecking_store_len_num.ark @@ -0,0 +1,2 @@ +(let a 1) +(let l (len a)) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_block.ark b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_block.ark new file mode 100644 index 000000000..5b06e2a97 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_block.ark @@ -0,0 +1,5 @@ +{ + (print 1) + (print 2) + (let a 3) +} diff --git a/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comment_after_macro_args.ark b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comment_after_macro_args.ark new file mode 100644 index 000000000..b05a5598b --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_comment_after_macro_args.ark @@ -0,0 +1,5 @@ +(macro bar ( +a +b +) # c +()) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_long_arg_list.ark b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_long_arg_list.ark new file mode 100644 index 000000000..f4a213138 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_formattersuite_long_arg_list.ark @@ -0,0 +1 @@ +(fun (&name &passed &failed &failures &cases &case_pointer &case_desc &display_cases_success &toggle_display_cases_success &inc_passed &inc_failed ®ister_failure &add_case &pop_case &update_case_ptr &need_case? &active &set_active) ()) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_langsuite_async-tests.ark b/tests/fuzzing/corpus/tests_unittests_resources_langsuite_async-tests.ark index f80e2b9d7..5765de8e7 100644 --- a/tests/fuzzing/corpus/tests_unittests_resources_langsuite_async-tests.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_langsuite_async-tests.ark @@ -1,8 +1,10 @@ (import std.Testing) (import std.List) +(import std.Sys :sleep) (let foo (fun (a b) (+ a b))) (let async-foo (async foo 1 2)) +(let async-foo-2 (async foo 2 3)) (let size 1000) (let data (list:fill size 1)) @@ -15,6 +17,13 @@ acc })) (test:suite async { + (test:case "compare futures" { + (test:expect (not (< async-foo async-foo-2))) + (test:expect (not (= async-foo async-foo-2))) + (test:expect (= async-foo async-foo)) + (test:expect (not (empty? (toString async-foo-2)))) + (del async-foo-2) }) + (test:case "async-foo should be an awaitable function returning 3" { (test:eq (type async-foo) "UserType") (test:eq (await async-foo) 3)}) @@ -37,4 +46,20 @@ (let time-async (- (time) start-async)) (test:eq 1000 res-async) - (test:eq 1000 res-non-async)})}) + (test:eq 1000 res-non-async)}) + + (test:case "execution contexts get reused" { + # this forces the VM to create more than 5 execution context, + # and delete the 6th + (async sleep 128) + (async sleep 128) + (async sleep 128) + (async sleep 128) + (async sleep 128) + (sleep 250) # wait for the async call to complete + + # we have 5 contexts here, and 4 that are free to be (re)used + (async sleep 128) (sleep 200) + (async sleep 128) (sleep 200) + (async sleep 128) (sleep 200) + (async sleep 128) (sleep 200) }) }) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_langsuite_builtins-tests.ark b/tests/fuzzing/corpus/tests_unittests_resources_langsuite_builtins-tests.ark index 8343bacbc..781890681 100644 --- a/tests/fuzzing/corpus/tests_unittests_resources_langsuite_builtins-tests.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_langsuite_builtins-tests.ark @@ -1,50 +1,21 @@ (import std.Testing) (import std.List) -(let foo (fun () ())) -(let closure (fun (&foo) ())) - (test:suite builtin { - (test:case "types" { - (test:eq (type []) "List") - (test:eq (type true) "Bool") - (test:eq (type false) "Bool") - (test:eq (type nil) "Nil") - (test:eq (type 1) "Number") - (test:eq (type "hello") "String") - (test:eq (type print) "CProc") - (test:eq (type foo) "Function") - (test:eq (type closure) "Closure") }) - - (test:case "closures" { - (mut keep true) - (mut foo nil) - (while keep { - (set foo (fun (&keep) keep)) - (set keep false) }) - (test:expect foo.keep "capture inside a deeper scope works") }) - (test:case "time" { (let old (time)) (builtin__sys:sleep 1) (test:expect (< old (time))) }) - (mut rands []) - (mut i 0) - (while (< i 100) { - (append! rands (random 0 10)) - (set i (+ 1 i)) }) - (test:expect - (not (list:any rands (fun (e) (or (< e 0) (> e 10))))) - "should not find any number outside the given range") - - (let r (random)) - (test:expect (and (<= r 2147483647) (>= r -2147483648))) + (test:case "random" { + (mut rands []) + (mut i 0) + (while (< i 100) { + (append! rands (random 0 10)) + (set i (+ 1 i)) }) + (test:expect + (not (list:any rands (fun (e) (or (< e 0) (> e 10))))) + "should not find any number outside the given range") - # no need to test all 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 - (test:case "math" { - (test:expect (not (builtin__math:NaN? 1))) - (test:expect (builtin__math:NaN? builtin__math:NaN)) - (test:expect (not (builtin__math:Inf? 100000))) - (test:expect (builtin__math:Inf? builtin__math:Inf)) }) }) + (let r (random)) + (test:expect (and (<= r 2147483647) (>= r -2147483648))) })}) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_langsuite_macro-tests.ark b/tests/fuzzing/corpus/tests_unittests_resources_langsuite_macro-tests.ark index e2a51691d..3b41e82f3 100644 --- a/tests/fuzzing/corpus/tests_unittests_resources_langsuite_macro-tests.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_langsuite_macro-tests.ark @@ -127,6 +127,12 @@ (test:eq (last 1 3 4) 4) (test:eq (last 1 5 6 7 8) 8) }) + (test:case "builtin macros" { + (macro nil-type ($type nil)) + (macro bool-type ($type true)) + (test:eq "Nil" nil-type) + (test:eq "Bool" bool-type) }) + (test:case "generate valid arkscript code with macros" { (macro make-func (retval) (fun () retval)) (let a-func (make-func 1)) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_langsuite_module-tests.ark b/tests/fuzzing/corpus/tests_unittests_resources_langsuite_module-tests.ark new file mode 100644 index 000000000..2849d5ec5 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_langsuite_module-tests.ark @@ -0,0 +1,12 @@ +(import std.Testing) + +(test:suite module { + (test:case "import and call plugin" { + (import testmodule) + + (test:eq (testmodule:foo 1) 1) + (test:eq (testmodule:foo) nil) }) + + (test:case "load twice the same module without error" { + (import testmodule) + (import testmodule) })}) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_langsuite_unittests.ark b/tests/fuzzing/corpus/tests_unittests_resources_langsuite_unittests.ark index 11ece0952..07d34faf5 100644 --- a/tests/fuzzing/corpus/tests_unittests_resources_langsuite_unittests.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_langsuite_unittests.ark @@ -1,5 +1,6 @@ (import vm-tests) (import builtins-tests) +(import module-tests) (import utf8-tests) (import macro-tests) (import list-tests) @@ -11,6 +12,7 @@ (let outputs (list:unzip [ vm-tests:vm-output builtins-tests:builtin-output + module-tests:module-output utf8-tests:utf8-output macro-tests:macro-output list-tests:list-output diff --git a/tests/fuzzing/corpus/tests_unittests_resources_langsuite_vm-tests.ark b/tests/fuzzing/corpus/tests_unittests_resources_langsuite_vm-tests.ark index 83a0feb95..a03f5a669 100644 --- a/tests/fuzzing/corpus/tests_unittests_resources_langsuite_vm-tests.ark +++ b/tests/fuzzing/corpus/tests_unittests_resources_langsuite_vm-tests.ark @@ -1,7 +1,8 @@ (import std.Testing) (let tests 0) -(let closure (fun (&tests) ())) +(let foo 12) +(let closure (fun (&tests &foo) ())) (let make (fun (a b c) (fun (&a &b &c) ()))) (let make2 (fun (a b c) @@ -51,6 +52,7 @@ (test:expect (>= 0 -4)) (test:expect (>= "hello" "hello")) (test:expect (>= "hello" "abc")) + (test:expect (< 1 "a")) # comparisons between types are ordered on type id... (test:neq "hello" "abc") (test:neq nil true) (test:neq nil false) @@ -59,7 +61,8 @@ (test:neq "" 1) (test:neq "" nil) (test:neq "" true) - (test:neq "" false) }) + (test:neq "" false) + (test:expect (< parent bob)) }) (test:case "lengths and list operations" { (test:eq (len "hello") 5) @@ -68,6 +71,7 @@ (test:eq (len []) 0) (test:expect (empty? "")) (test:expect (empty? [])) + (test:expect (not [])) (test:eq (tail "") "") (test:eq (tail "a") "") (test:eq (tail "abc") "bc") @@ -93,7 +97,8 @@ (test:eq (toString true) "true") (test:eq (toString false) "false") (test:eq (toString [1 2]) "[1 2]") - (test:eq (toString ["12"]) "[\"12\"]") }) + (test:eq (toString ["12"]) "[\"12\"]") + (test:eq (toString (dict "key" "value")) "{key: value}") }) (test:case "indexing" { (test:eq (@ "hello" 1) "e") @@ -101,7 +106,14 @@ (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:eq (@ ["h" "e" "l" "l" "o"] -4) "e") + + (let lst [1 2 3]) + (let idx 1) + # AT_SYM_INDEX_SYM_INDEX + (test:eq (@ lst idx) 2) + # AT_SYM_INDEX_CONST + (test:eq (@ lst 1) 2) }) (test:case "Short-circuiting" { (let falsy (fun () { @@ -126,11 +138,12 @@ (test:eq (type nil) "Nil") (test:eq (type true) "Bool") (test:eq (type false) "Bool") - (test:expect (hasField closure "vm-tests:tests")) + (test:eq (type (dict)) "Dict") + (test:expect (hasField closure "tests")) (test:expect (not (hasField closure "12"))) }) (test:case "closures" { - (test:eq (toString closure) "(.vm-tests:tests=0)") + (test:eq (toString closure) "(.tests=0 .foo=12)") (test:eq closure_1 closure_1_bis) (test:eq closure_1 closure_2) (test:neq closure_1 closure_4) @@ -146,21 +159,76 @@ (parent.child.call) (test:eq (parent.child.get) [5 12]) }) + (test:case "closure capture" { + (mut keep true) + (mut foo nil) + (while keep { + (set foo (fun (&keep) keep)) + (set keep false) }) + (test:expect foo.keep "capture inside a deeper scope works") }) + (test:case "increment and decrement vars" { (mut var 0) + # INCREMENT_BY_INDEX (set var (+ var 5)) + # INCREMENT_BY_INDEX (set var (+ 10 var)) + # DECREMENT_BY_INDEX (set var (- var 1)) + # INCREMENT_STORE + ((fun () (set var (+ 1 var)))) + # DECREMENT_STORE + ((fun () (set var (- var 1)))) + (test:eq 15 ((fun () (+ var 1)))) + (test:eq 13 ((fun () (- var 1)))) (test:eq var 14) }) + (test:case "hack to test usually optimized append_in_place" { + (mut data []) + (append! ((fun () data)) 5) }) + + (test:case "optimized jumps" { + (mut i 10) + (let n 5) + # GT_SYM_JUMP_IF_FALSE + (while (> i n) (set i (- i 1))) + # GT_CONST_JUMP_IF_FALSE + (while (> i 5) (set i (- i 1))) + (test:eq i 5) }) + (test:case "set/store head and tail" { (mut data [1 2 3 4]) + # STORE_LEN + (let length (len data)) + (test:eq length 4) + + # STORE_TAIL_BY_INDEX (let data2 (tail data)) + # SET_VAL_TAIL_BY_INDEX (set data (tail data)) (test:eq data2 data) (test:eq data [2 3 4]) + # SET_VAL_TAIL + ((fun () (set data (tail data)))) + (test:eq data [3 4]) + + (mut tmp [1 2 3]) + # SET_VAL_HEAD + ((fun () (set tmp (head tmp)))) + (test:eq tmp 1) + + # STORE_HEAD + ((fun () { + (let data_head (head data)) + (test:eq data_head 3) })) + ((fun () { + (let data_tail (tail data)) + (test:eq data_tail [4]) })) + + # STORE_HEAD_BY_INDEX (let data3 (head data)) + # SET_VAL_HEAD_BY_INDEX (set data (head data)) (test:eq data3 data) - (test:eq data 2) })}) + (test:eq data 3) })}) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_resolve_prefixed_in_correct_import_a.ark b/tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_resolve_prefixed_in_correct_import_a.ark new file mode 100644 index 000000000..baca4bb01 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_resolve_prefixed_in_correct_import_a.ark @@ -0,0 +1,4 @@ +(import c) +(import b :forEach) + +(let ok (and (= forEach "b") (= c:forEach "c") (= b:forEach "b"))) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_resolve_prefixed_in_correct_import_b.ark b/tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_resolve_prefixed_in_correct_import_b.ark new file mode 100644 index 000000000..a67f91038 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_resolve_prefixed_in_correct_import_b.ark @@ -0,0 +1 @@ +(let forEach "b") diff --git a/tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_resolve_prefixed_in_correct_import_c.ark b/tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_resolve_prefixed_in_correct_import_c.ark new file mode 100644 index 000000000..afe7971f2 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_resolve_prefixed_in_correct_import_c.ark @@ -0,0 +1 @@ +(let forEach "c") diff --git a/tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_a.ark b/tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_a.ark new file mode 100644 index 000000000..a25331c19 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_a.ark @@ -0,0 +1,4 @@ +(import b :find) +(import c :find) + +(let ok (and (= find "b.ark") (= b:find "b.ark") (= c:find "c.ark"))) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_b.ark b/tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_b.ark new file mode 100644 index 000000000..b1e50e527 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_b.ark @@ -0,0 +1 @@ +(let find "b.ark") diff --git a/tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_hidden_shadowing_c.ark b/tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_c.ark similarity index 100% rename from tests/fuzzing/corpus-cmin/tests_unittests_resources_nameresolutionsuite_hidden_shadowing_c.ark rename to tests/fuzzing/corpus/tests_unittests_resources_nameresolutionsuite_symbol_imports_same_name_c.ark diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_field.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_field.ark new file mode 100644 index 000000000..91a464c2c --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_field.ark @@ -0,0 +1 @@ +(print a.) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_fun_in_macro.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_fun_in_macro.ark new file mode 100644 index 000000000..81ba1b375 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_fun_in_macro.ark @@ -0,0 +1,2 @@ +(macro bar { + (let foo (fun (a b))) }) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_spread.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_spread.ark new file mode 100644 index 000000000..b259da2bd --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incomplete_spread.ark @@ -0,0 +1 @@ +(macro foo (...) ()) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incorrect_function_call.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incorrect_function_call.ark new file mode 100644 index 000000000..4325e0866 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_incorrect_function_call.ark @@ -0,0 +1 @@ +(1 2 3) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_4.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_4.ark new file mode 100644 index 000000000..f21bf81c0 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_4.ark @@ -0,0 +1 @@ +(print "\ugggg") diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_8.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_8.ark new file mode 100644 index 000000000..bed84a9d8 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_invalid_escape_seq_8.ark @@ -0,0 +1 @@ +(print "\Ugggg") diff --git a/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_invalid_hex8_escape_seq.ark b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_invalid_hex8_escape_seq.ark new file mode 100644 index 000000000..e77c0af1b --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_parsersuite_failure_invalid_hex8_escape_seq.ark @@ -0,0 +1 @@ +(print "\UFFFFFFFF") diff --git a/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_ascii_lowercase.ark b/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_ascii_lowercase.ark new file mode 100644 index 000000000..c2e61d5cd --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_ascii_lowercase.ark @@ -0,0 +1,9 @@ +(import std.String) + +(mut letters "") +(mut c (string:ord "a")) +(while (<= c (string:ord "z")) { + (set letters (+ letters (string:chr c))) + (set c (+ c 1)) }) + +(assert (= letters string:asciiLowercase) "correctly computed letters") diff --git a/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_count_occurrences_of_substring.ark b/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_count_occurrences_of_substring.ark new file mode 100644 index 000000000..b82ec2488 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_count_occurrences_of_substring.ark @@ -0,0 +1,12 @@ +(import std.String) + +(let count (fun (str word) { + (mut count 0) + (mut next (string:find str word)) + (while (!= -1 next) { + (set count (+ 1 count)) + (set next (string:findAfter str word (+ next (len word)))) }) + count })) + +(assert (= 3 (count "the three truths" "th")) "3 th in the string") +(assert (= 2 (count "ababababab" "abab")) "2 abab in the string") diff --git a/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_middle_three_digits.ark b/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_middle_three_digits.ark new file mode 100644 index 000000000..0658c6010 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_middle_three_digits.ark @@ -0,0 +1,23 @@ +(import std.Math) +(import std.String) + +(let middle_three_digits (fun (i) { + (let s (toString (math:abs i))) + (if (and (math:odd (len s)) (>= (len s) 3)) + (string:slice s (- (/ (len s) 2) 1) 3) + nil) })) + +(import std.List :map) + +(assert + (= + (map [123 12345 1234567 987654321 10001 -10001 -123 -100 100 -12345] + middle_three_digits) + ["123" "234" "345" "654" "000" "000" "123" "100" "100" "234"]) + "good numbers work") +(assert + (= + (map [1 2 -1 -10 2002 -2002 0] + middle_three_digits) + [nil nil nil nil nil nil nil]) + "bad numbers do not work") diff --git a/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_n_queens.ark b/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_n_queens.ark new file mode 100644 index 000000000..afe1b169e --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_n_queens.ark @@ -0,0 +1,32 @@ +(let queenPuzzle (fun (rows columns) + (if (<= rows 0) + [[]] + (addQueen (- rows 1) columns)))) + +(let addQueen (fun (newRow columns) { + (mut newSolutions []) + (let prev (queenPuzzle newRow columns)) + + (mut i 0) + (while (< i (len prev)) { + (let solution (@ prev i)) + (mut newColumn 0) + (while (< newColumn columns) { + (if (not (hasConflict newRow newColumn solution)) (append! newSolutions (append solution newColumn))) + (set newColumn (+ newColumn 1)) }) + + (set i (+ i 1)) }) + + newSolutions })) + +(let hasConflict (fun (newRow newColumn solution) { + (mut i 0) + (mut conflict false) + (while (and (< i newRow) (not conflict)) { + (if (or (= (@ solution i) newColumn) (= (+ (@ solution i) i) (+ newColumn newRow)) (= (- (@ solution i) i) (- newColumn newRow))) + (set conflict true)) + (set i (+ i 1)) }) + + conflict })) + +(assert (= (queenPuzzle 4 4) [[1 3 0 2] [2 0 3 1]]) "The two correct solutions were found") diff --git a/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_nested_functions.ark b/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_nested_functions.ark new file mode 100644 index 000000000..78db09332 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_nested_functions.ark @@ -0,0 +1,9 @@ +(let makeList (fun (separator) { + (mut counter 1) + (let makeItem (fun (item) { + (let res (format "{}{}{}\n" counter separator item)) + (set counter (+ 1 counter)) + res })) + (+ (makeItem "first") (makeItem "second") (makeItem "third")) })) + +(print (makeList ". ")) diff --git a/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_pangram.ark b/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_pangram.ark new file mode 100644 index 000000000..71688ac52 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_pangram.ark @@ -0,0 +1,16 @@ +(import std.String) +(import std.List) +(import std.Dict) + +(let pangram? (fun (str) { + (mut d (dict)) + (let keys + (list:filter + (list:map str (fun (c) (string:toLower c))) + (fun (c) (!= -1 (string:find string:asciiLowercase c))))) + (list:forEach keys + (fun (k) (dict:add d k (if (nil? (dict:get d k)) 0 (+ 1 (dict:get d k)))))) + (= (len string:asciiLowercase) (len (dict:keys d))) })) + +(assert (pangram? "The quick brown fox jumps over the lazy dog") "pangram is detected") +(assert (not (pangram? "abcdfghmnopqruvxy")) "no pangram should be detected") diff --git a/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_riordan_numbers.ark b/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_riordan_numbers.ark new file mode 100644 index 000000000..882ce96a1 --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_riordan_numbers.ark @@ -0,0 +1,14 @@ +(import std.Math) + +(let riordan (fun (n) { + (mut a [1 0 1]) + (mut i 3) + (while (< i n) { + (append! a (math:floordiv (* (- i 1) (+ (* 2 (@ a (- i 1))) (* 3 (@ a (- i 2))))) (+ i 1))) + (set i (+ 1 i)) }) + a })) + +(let nums (riordan 32)) +(import std.List) +(list:forEach nums (fun (n) (puts (format "{:18}" n)))) +(puts "\n") diff --git a/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_stack.ark b/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_stack.ark new file mode 100644 index 000000000..be2a50abb --- /dev/null +++ b/tests/fuzzing/corpus/tests_unittests_resources_rosettasuite_stack.ark @@ -0,0 +1,26 @@ +(let stack (fun () { + (mut data []) + + (let push (fun (value) (set data (concat [value] data)))) + (let popTop (fun () { + (let res (head data)) + (pop! data 0) + res })) + (let isEmpty? (fun () (empty? data))) + + (fun (&data &push &popTop &isEmpty?) ()) })) + +(let myStack (stack)) +(myStack.push 1) +(myStack.push 2) +(myStack.push 3) + +(assert (= myStack.data [3 2 1]) "stack is [3 2 1]") + +(assert (= 3 (myStack.popTop)) "top is 3") +(assert (= myStack.data [2 1]) "stack has one less element") + +(assert (not (myStack.isEmpty?)) "stack is not empty") +(myStack.popTop) +(myStack.popTop) +(assert (myStack.isEmpty?) "stack is empty") From 77f93259093fdd5518a3a9b73b7b633bb34ed0e6 Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Mon, 8 Sep 2025 17:53:06 +0200 Subject: [PATCH 02/13] feat(fuzzing): improve fuzzing scripts CLI --- tests/fuzzing/docker/setup-container.sh | 2 +- tests/fuzzing/start-afl-docker.sh | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/fuzzing/docker/setup-container.sh b/tests/fuzzing/docker/setup-container.sh index 23be4904e..afc2c10e9 100644 --- a/tests/fuzzing/docker/setup-container.sh +++ b/tests/fuzzing/docker/setup-container.sh @@ -28,4 +28,4 @@ echo "Starting sub-fuzzer" && tmux new-session -d './tests/fuzzing/docker/2-fuzz echo "Starting sub-fuzzer" && tmux new-session -d './tests/fuzzing/docker/2-fuzz.sh 3' echo "Starting sub-fuzzer" && tmux new-session -d './tests/fuzzing/docker/2-fuzz.sh 4' -tmux attach 0 +tmux attach -t 0 diff --git a/tests/fuzzing/start-afl-docker.sh b/tests/fuzzing/start-afl-docker.sh index 4c5cec7e7..dda0ffd5d 100755 --- a/tests/fuzzing/start-afl-docker.sh +++ b/tests/fuzzing/start-afl-docker.sh @@ -30,6 +30,12 @@ generate_corpus_in_docker() { bash /src/tests/fuzzing/docker/build-and-make-corpus.sh } +usage() { + 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/" +} + if [[ $# == 1 ]]; then case $1 in fuzz) @@ -40,11 +46,9 @@ if [[ $# == 1 ]]; then 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/" + usage ;; esac else - start_afl_with_ramdisk + usage fi From 8dfda27654e05ea907df08bf1b8a24391fe53f23 Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Mon, 8 Sep 2025 18:15:01 +0200 Subject: [PATCH 03/13] fix(macros): add better arity checking on macro expansion --- include/Ark/Compiler/Macros/Processor.hpp | 3 +- src/arkreactor/Compiler/Macros/Processor.cpp | 66 ++++++++++++------- .../compileTime/macro_argcount_arity.ark | 2 + .../compileTime/macro_argcount_arity.expected | 5 ++ .../compileTime/macro_repr_arity.ark | 1 + .../compileTime/macro_repr_arity.expected | 6 ++ 6 files changed, 57 insertions(+), 26 deletions(-) create mode 100644 tests/unittests/resources/DiagnosticsSuite/compileTime/macro_argcount_arity.ark create mode 100644 tests/unittests/resources/DiagnosticsSuite/compileTime/macro_argcount_arity.expected create mode 100644 tests/unittests/resources/DiagnosticsSuite/compileTime/macro_repr_arity.ark create mode 100644 tests/unittests/resources/DiagnosticsSuite/compileTime/macro_repr_arity.expected diff --git a/include/Ark/Compiler/Macros/Processor.hpp b/include/Ark/Compiler/Macros/Processor.hpp index 34c68d000..9bd6b4212 100644 --- a/include/Ark/Compiler/Macros/Processor.hpp +++ b/include/Ark/Compiler/Macros/Processor.hpp @@ -151,9 +151,10 @@ namespace Ark::internal * @param node a list node with a macro application, eg (= a b) * @param expected expected argument count, not counting the macro * @param name the name of the macro being applied + * @param is_expansion if the error message should switch from "Interpreting ..." to "When expanding ..." * @param kind the macro kind, empty by default (eg "operator", "condition") */ - void checkMacroArgCountEq(const Node& node, std::size_t expected, const std::string& name, const std::string& kind = ""); + void checkMacroArgCountEq(const Node& node, std::size_t expected, const std::string& name, bool is_expansion = false, const std::string& kind = ""); /** * @brief Check if the given node has at least the provided argument count, otherwise throws an error diff --git a/src/arkreactor/Compiler/Macros/Processor.cpp b/src/arkreactor/Compiler/Macros/Processor.cpp index baba8c018..9b4991468 100644 --- a/src/arkreactor/Compiler/Macros/Processor.cpp +++ b/src/arkreactor/Compiler/Macros/Processor.cpp @@ -208,19 +208,31 @@ namespace Ark::internal return false; } - void MacroProcessor::checkMacroArgCountEq(const Node& node, std::size_t expected, const std::string& name, const std::string& kind) + void MacroProcessor::checkMacroArgCountEq(const Node& node, std::size_t expected, const std::string& name, const bool is_expansion, const std::string& kind) { const std::size_t argcount = node.constList().size(); if (argcount != expected + 1) - throwMacroProcessingError( - fmt::format( - "Interpreting a `{}'{} with {} argument{}, expected {}.", - name, - kind.empty() ? kind : " " + kind, - argcount - 1, - argcount > 2 ? "s" : "", - expected), - node); + { + if (is_expansion) + throwMacroProcessingError( + fmt::format( + "When expanding `{}' inside a macro, got {} argument{}, expected {}", + name, + argcount - 1, + argcount > 2 ? "s" : "", + expected), + node); + else + throwMacroProcessingError( + fmt::format( + "Interpreting a `{}'{} with {} argument{}, expected {}.", + name, + kind.empty() ? kind : " " + kind, + argcount - 1, + argcount > 2 ? "s" : "", + expected), + node); + } } void MacroProcessor::checkMacroArgCountGe(const Node& node, std::size_t expected, const std::string& name, const std::string& kind) @@ -260,42 +272,42 @@ namespace Ark::internal } else if (name == "=" && is_not_body) { - checkMacroArgCountEq(node, 2, "=", "condition"); + checkMacroArgCountEq(node, 2, "=", /* is_expansion= */ false, "condition"); const Node one = evaluate(node.list()[1], depth + 1, is_not_body); const Node two = evaluate(node.list()[2], depth + 1, is_not_body); return (one == two) ? getTrueNode() : getFalseNode(); } else if (name == "!=" && is_not_body) { - checkMacroArgCountEq(node, 2, "!=", "condition"); + checkMacroArgCountEq(node, 2, "!=", /* is_expansion= */ false, "condition"); const Node one = evaluate(node.list()[1], depth + 1, is_not_body); const Node two = evaluate(node.list()[2], depth + 1, is_not_body); return (one != two) ? getTrueNode() : getFalseNode(); } else if (name == "<" && is_not_body) { - checkMacroArgCountEq(node, 2, "<", "condition"); + checkMacroArgCountEq(node, 2, "<", /* is_expansion= */ false, "condition"); const Node one = evaluate(node.list()[1], depth + 1, is_not_body); const Node two = evaluate(node.list()[2], depth + 1, is_not_body); return (one < two) ? getTrueNode() : getFalseNode(); } else if (name == ">" && is_not_body) { - checkMacroArgCountEq(node, 2, ">", "condition"); + checkMacroArgCountEq(node, 2, ">", /* is_expansion= */ false, "condition"); const Node one = evaluate(node.list()[1], depth + 1, is_not_body); const Node two = evaluate(node.list()[2], depth + 1, is_not_body); return !(one < two) && (one != two) ? getTrueNode() : getFalseNode(); } else if (name == "<=" && is_not_body) { - checkMacroArgCountEq(node, 2, "<=", "condition"); + checkMacroArgCountEq(node, 2, "<=", /* is_expansion= */ false, "condition"); const Node one = evaluate(node.list()[1], depth + 1, is_not_body); const Node two = evaluate(node.list()[2], depth + 1, is_not_body); return one < two || one == two ? getTrueNode() : getFalseNode(); } else if (name == ">=" && is_not_body) { - checkMacroArgCountEq(node, 2, ">=", "condition"); + checkMacroArgCountEq(node, 2, ">=", /* is_expansion= */ false, "condition"); const Node one = evaluate(node.list()[1], depth + 1, is_not_body); const Node two = evaluate(node.list()[2], depth + 1, is_not_body); return !(one < two) ? getTrueNode() : getFalseNode(); @@ -362,7 +374,7 @@ namespace Ark::internal } else if (name == "not" && is_not_body) { - checkMacroArgCountEq(node, 1, "not", "condition"); + checkMacroArgCountEq(node, 1, "not", /* is_expansion= */ false, "condition"); return (!isTruthy(evaluate(node.list()[1], depth + 1, is_not_body))) ? getTrueNode() : getFalseNode(); } else if (name == Language::And && is_not_body) @@ -391,8 +403,8 @@ namespace Ark::internal } else if (name == "len") { - if (node.list().size() > 2) - throwMacroProcessingError(fmt::format("When expanding `len' inside a macro, got {} arguments, expected 1", argcount), node); + checkMacroArgCountEq(node, 1, "len", true); + if (Node& lst = node.list()[1]; lst.nodeType() == NodeType::List) // only apply len at compile time if we can { if (isConstEval(lst)) @@ -406,8 +418,8 @@ namespace Ark::internal } else if (name == "empty?") { - if (node.list().size() > 2) - throwMacroProcessingError(fmt::format("When expanding `empty?' inside a macro, got {} arguments, expected 1", argcount), node); + checkMacroArgCountEq(node, 1, "empty?", true); + if (Node& lst = node.list()[1]; lst.nodeType() == NodeType::List && isConstEval(lst)) { // only apply len at compile time if we can @@ -454,8 +466,8 @@ namespace Ark::internal } else if (name == "head") { - if (node.list().size() > 2) - throwMacroProcessingError(fmt::format("When expanding `head' inside a macro, got {} arguments, expected 1", argcount), node); + checkMacroArgCountEq(node, 1, "head", true); + if (node.list()[1].nodeType() == NodeType::List) { Node& sublist = node.list()[1]; @@ -477,8 +489,8 @@ namespace Ark::internal } else if (name == "tail") { - if (node.list().size() > 2) - throwMacroProcessingError(fmt::format("When expanding `tail' inside a macro, got {} arguments, expected 1", argcount), node); + checkMacroArgCountEq(node, 1, "tail", true); + if (node.list()[1].nodeType() == NodeType::List) { Node sublist = node.list()[1]; @@ -555,6 +567,8 @@ namespace Ark::internal } else if (name == Language::Argcount) { + checkMacroArgCountEq(node, 1, Language::Argcount.data(), true); + const Node sym = node.constList()[1]; if (sym.nodeType() == NodeType::Symbol) { @@ -570,6 +584,8 @@ namespace Ark::internal } else if (name == Language::Repr) { + checkMacroArgCountEq(node, 1, Language::Repr.data(), true); + const Node arg = node.constList()[1]; node.updateValueAndType(Node(NodeType::String, arg.repr())); } diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_argcount_arity.ark b/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_argcount_arity.ark new file mode 100644 index 000000000..b17f2dc17 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_argcount_arity.ark @@ -0,0 +1,2 @@ +(let a 5) +(print ($argcount) a) diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_argcount_arity.expected b/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_argcount_arity.expected new file mode 100644 index 000000000..94dfb7cc1 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_argcount_arity.expected @@ -0,0 +1,5 @@ + 1 | (let a 5) + 2 | (print ($argcount) a) + | ^~~~~~~~~~~ + 3 | + When expanding `$argcount' inside a macro, got 0 argument, expected 1 diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_repr_arity.ark b/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_repr_arity.ark new file mode 100644 index 000000000..6841dd609 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_repr_arity.ark @@ -0,0 +1 @@ +(let foo ($repr)) diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_repr_arity.expected b/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_repr_arity.expected new file mode 100644 index 000000000..72de8af1e --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_repr_arity.expected @@ -0,0 +1,6 @@ + 1 | (let foo ($repr)) + | │ └─ error + | │ + | └─ macro expansion started here + 2 | + When expanding `$repr' inside a macro, got 0 argument, expected 1 From 7270b3882c9aad448578292552ff758e71945134 Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Mon, 8 Sep 2025 19:20:11 +0200 Subject: [PATCH 04/13] fix(macros): we shouldn't be able to define macros reusing macro argument names --- src/arkreactor/Compiler/Macros/Executors/Function.cpp | 10 ++++++++++ .../compileTime/macro_shadowing_args.ark | 8 ++++++++ .../compileTime/macro_shadowing_args.expected | 10 ++++++++++ 3 files changed, 28 insertions(+) create mode 100644 tests/unittests/resources/DiagnosticsSuite/compileTime/macro_shadowing_args.ark create mode 100644 tests/unittests/resources/DiagnosticsSuite/compileTime/macro_shadowing_args.expected diff --git a/src/arkreactor/Compiler/Macros/Executors/Function.cpp b/src/arkreactor/Compiler/Macros/Executors/Function.cpp index 0f581148d..8cb5cccb7 100644 --- a/src/arkreactor/Compiler/Macros/Executors/Function.cpp +++ b/src/arkreactor/Compiler/Macros/Executors/Function.cpp @@ -111,6 +111,16 @@ namespace Ark::internal } else if (target.isListLike()) { + if (target.nodeType() == NodeType::Macro && target.list()[0].nodeType() == NodeType::Symbol) + { + if (const std::string macro_name = target.list()[0].string(); map.contains(macro_name)) + throwMacroProcessingError( + fmt::format( + "Can not define a macro by reusing the argument name `{}'", + macro_name), + target); + } + for (std::size_t i = 0; i < target.list().size(); ++i) unify(map, target.list()[i], &target, i, unify_depth + 1); } diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_shadowing_args.ark b/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_shadowing_args.ark new file mode 100644 index 000000000..87d7e3017 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_shadowing_args.ark @@ -0,0 +1,8 @@ +(macro ! (call ...all_args) { + (macro all_args 5) + (fun (arg_bloc) (call all_args)) }) + +(let foo (fun (a b c d) ())) + +(let t (! foo _ 1 _ 2)) +(print (t 5 6)) diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_shadowing_args.expected b/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_shadowing_args.expected new file mode 100644 index 000000000..153a591de --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_shadowing_args.expected @@ -0,0 +1,10 @@ + 1 | (macro __replace_placeholders (replacements ...xs) { xs }) + 2 | (macro ! (call ...all_args) { + | ^ macro expansion started here + 3 | (macro all_args 5) + | ^~~~~~~~~~~~~~~~~ + 4 | (fun (arg_bloc) (call all_args)) }) + | ^ + 5 | + 6 | (let foo (fun (a b c d) ())) + Can not define a macro by reusing the argument name `all_args' From b1e190087e3c822613d1c71c037ba74e0735a279 Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Wed, 10 Sep 2025 10:12:38 +0200 Subject: [PATCH 05/13] fix(vm): adding a 256 buffer at the end of the stack, plus a periodic check (every 256 instructions) on the stack size to catch stack overflows --- CHANGELOG.md | 1 + include/Ark/Constants.hpp.in | 6 +++-- include/Ark/VM/ExecutionContext.hpp | 3 ++- .../Compiler/Macros/Executors/Function.cpp | 2 ++ src/arkreactor/VM/VM.cpp | 23 ++++++++++++------- 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d04762885..3a735be34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -154,6 +154,7 @@ - captures are not renamed anymore by the NameResolutionPass (which used to fully qualify captured names when possible, which isn't desirable: when you capture `&foo`, you expect to be able to use `.foo` not `.module:foo`) - when loading a module, its mappings are loaded in the current scope instead of the global scope - argument order in the CLI changed: the file to run (and its optional script arguments) are now last, to be more consistent with all the other existing tooling (Python, Docker...) +- VM stack size has been upped to 4096 + 256, to have a buffer to be able to catch stack overflows without hindering performances too much ### Removed - removed unused `NodeType::Closure` diff --git a/include/Ark/Constants.hpp.in b/include/Ark/Constants.hpp.in index 1cac2ffe3..4d572cee9 100644 --- a/include/Ark/Constants.hpp.in +++ b/include/Ark/Constants.hpp.in @@ -69,10 +69,12 @@ namespace Ark constexpr uint16_t MaxValue16Bits = std::numeric_limits::max(); - constexpr std::size_t MaxNestedNodes = 1024; ///< Maximum number of nodes that can be nested while parsing code - constexpr std::size_t MaxMacroProcessingDepth = 256; ///< Controls the number of recursive calls to MacroProcessor::processNode + constexpr std::size_t MaxNestedNodes = 1024; ///< Maximum number of nodes that can be nested while parsing code + constexpr std::size_t MaxMacroProcessingDepth = 256; ///< Controls the number of recursive calls to MacroProcessor::processNode constexpr std::size_t MaxMacroUnificationDepth = 256; ///< Controls the number of recursive calls to MacroProcessor::unify constexpr std::size_t VMStackSize = 4096; + constexpr std::size_t VMOverflowBufferSize = 256; ///< Additional number of elements the stack can tolerate + constexpr std::size_t VMStackSizeWithOverflowBuffer = VMStackSize + VMOverflowBufferSize; ///< Exceeding VMStackSize, even if we are below VMStackSizeWithOverflowBuffer, means we stack overflowed constexpr std::size_t ScopeStackSize = 8192; } diff --git a/include/Ark/VM/ExecutionContext.hpp b/include/Ark/VM/ExecutionContext.hpp index 1a80e4212..9bac6ce0b 100644 --- a/include/Ark/VM/ExecutionContext.hpp +++ b/include/Ark/VM/ExecutionContext.hpp @@ -33,6 +33,7 @@ namespace Ark::internal uint16_t fc {}; ///< Frame count uint16_t last_symbol; const bool primary; ///< Tells if the current ExecutionContext is the primary one or not + uint16_t inst_exec_counter {}; std::atomic_bool active; std::optional saved_scope {}; ///< Scope created by CAPTURE instructions, used by the MAKE_CLOSURE instruction @@ -42,7 +43,7 @@ namespace Ark::internal std::vector locals {}; std::array scopes_storage {}; ///< All the ScopeView use this array to store id->value - std::array stack {}; + std::array stack {}; ExecutionContext() noexcept : last_symbol(MaxValue16Bits), diff --git a/src/arkreactor/Compiler/Macros/Executors/Function.cpp b/src/arkreactor/Compiler/Macros/Executors/Function.cpp index 8cb5cccb7..d02b29a11 100644 --- a/src/arkreactor/Compiler/Macros/Executors/Function.cpp +++ b/src/arkreactor/Compiler/Macros/Executors/Function.cpp @@ -38,6 +38,8 @@ namespace Ark::internal if (j >= args_needed) break; + // todo: this fails because we don't have a string because we are defining a (macro ! (call ...args) ...) inside another (macro ! (call ...args) ...) + // most likely the first macro got applied to another macro. We shouldn't apply macro on macros const std::string& arg_name = args.list()[j].string(); if (args.list()[j].nodeType() == NodeType::Symbol) { diff --git a/src/arkreactor/VM/VM.cpp b/src/arkreactor/VM/VM.cpp index fff1898a7..9bab0646c 100644 --- a/src/arkreactor/VM/VM.cpp +++ b/src/arkreactor/VM/VM.cpp @@ -505,14 +505,19 @@ namespace Ark # define GOTO_HALT() break #endif -#define NEXTOPARG() \ - do \ - { \ - inst = m_state.inst(context.pp, context.ip); \ - padding = m_state.inst(context.pp, context.ip + 1); \ - arg = static_cast((m_state.inst(context.pp, context.ip + 2) << 8) + \ - m_state.inst(context.pp, context.ip + 3)); \ - context.ip += 4; \ +#define NEXTOPARG() \ + do \ + { \ + inst = m_state.inst(context.pp, context.ip); \ + padding = m_state.inst(context.pp, context.ip + 1); \ + arg = static_cast((m_state.inst(context.pp, context.ip + 2) << 8) + \ + m_state.inst(context.pp, context.ip + 3)); \ + context.ip += 4; \ + context.inst_exec_counter = (context.inst_exec_counter + 1) % VMOverflowBufferSize; \ + if (context.inst_exec_counter < 2 && context.sp >= VMStackSize) \ + { \ + throw Error("Stack overflow"); \ + } \ } while (false) #define DISPATCH() \ NEXTOPARG(); \ @@ -761,6 +766,7 @@ namespace Ark push(Value(static_cast(context.pp)), context); // arg * 4 to skip over the call instruction, so that the return address points to AFTER the call push(Value(ValueType::InstPtr, static_cast(arg * 4)), context); + context.inst_exec_counter++; DISPATCH(); } @@ -1431,6 +1437,7 @@ namespace Ark UNPACK_ARGS(); push(loadConstAsPtr(primary_arg), context); push(loadConstAsPtr(secondary_arg), context); + context.inst_exec_counter++; DISPATCH(); } From 4582e1cc869049fe79b313e03fdead98b64eceec Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Wed, 10 Sep 2025 10:28:27 +0200 Subject: [PATCH 06/13] fix(ast lowerer): do not allow compiling calls to nodes that don't return a value --- src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp | 5 ++++- .../compileTime/can_not_call.expected | 4 ++-- .../DiagnosticsSuite/compileTime/can_not_call_let.ark | 1 + .../compileTime/can_not_call_let.expected | 4 ++++ .../compileTime/macro_shadowing_args.expected | 11 +++++------ .../DiagnosticsSuite/compileTime/well_formed_args.ark | 6 ++---- .../compileTime/well_formed_args.expected | 4 ++-- 7 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 tests/unittests/resources/DiagnosticsSuite/compileTime/can_not_call_let.ark create mode 100644 tests/unittests/resources/DiagnosticsSuite/compileTime/can_not_call_let.expected diff --git a/src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp b/src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp index 987397a88..e895a5431 100644 --- a/src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp +++ b/src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp @@ -604,6 +604,9 @@ namespace Ark::internal } else { + if (!nodeProducesOutput(node)) + buildAndThrowError(fmt::format("Can not call `{}', as it doesn't return a value", node.repr()), node); + m_temp_pages.emplace_back(); const auto proc_page = Page { .index = m_temp_pages.size() - 1u, .is_temp = true }; @@ -614,7 +617,7 @@ namespace Ark::internal // We can skip the LOAD_SYMBOL function_name and directly push the current // function page, which will be quicker than a local variable resolution. // We set its argument to the symbol id of the function we are calling, - // so that the VM knowns the name of the last called function. + // so that the VM knows the name of the last called function. page(proc_page).emplace_back(GET_CURRENT_PAGE_ADDR, addSymbol(node)); } else diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/can_not_call.expected b/tests/unittests/resources/DiagnosticsSuite/compileTime/can_not_call.expected index 2d3d6e87f..deb04b40a 100644 --- a/tests/unittests/resources/DiagnosticsSuite/compileTime/can_not_call.expected +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/can_not_call.expected @@ -1,4 +1,4 @@ 1 | (((begin))) - | ^~~~~~~~~ + | ^~~~~~~ 2 | - Can not call (begin) + Can not call `(begin)', as it doesn't return a value diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/can_not_call_let.ark b/tests/unittests/resources/DiagnosticsSuite/compileTime/can_not_call_let.ark new file mode 100644 index 000000000..077cb83eb --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/can_not_call_let.ark @@ -0,0 +1 @@ +((let in (list 0 0 3 4 5)) builtin__list:slice in 1 1 2) diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/can_not_call_let.expected b/tests/unittests/resources/DiagnosticsSuite/compileTime/can_not_call_let.expected new file mode 100644 index 000000000..b788997fe --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/can_not_call_let.expected @@ -0,0 +1,4 @@ + 1 | ((let in (list 0 0 3 4 5)) builtin__list:slice in 1 1 2) + | ^~~~~~~~~~~~~~~~~~~~~~~~~~ + 2 | + Can not call `(let in (list 0 0 3 4 5))', as it doesn't return a value diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_shadowing_args.expected b/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_shadowing_args.expected index 153a591de..d3a6a86b6 100644 --- a/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_shadowing_args.expected +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_shadowing_args.expected @@ -1,10 +1,9 @@ - 1 | (macro __replace_placeholders (replacements ...xs) { xs }) - 2 | (macro ! (call ...all_args) { + 1 | (macro ! (call ...all_args) { | ^ macro expansion started here - 3 | (macro all_args 5) + 2 | (macro all_args 5) | ^~~~~~~~~~~~~~~~~ - 4 | (fun (arg_bloc) (call all_args)) }) + 3 | (fun (arg_bloc) (call all_args)) }) | ^ - 5 | - 6 | (let foo (fun (a b c d) ())) + 4 | + 5 | (let foo (fun (a b c d) ())) Can not define a macro by reusing the argument name `all_args' diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/well_formed_args.ark b/tests/unittests/resources/DiagnosticsSuite/compileTime/well_formed_args.ark index 5ee42f4be..7636b5b4d 100644 --- a/tests/unittests/resources/DiagnosticsSuite/compileTime/well_formed_args.ark +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/well_formed_args.ark @@ -1,5 +1,3 @@ (macro defun (let name (fun args nil))) -(let foo 1) -(let a 2) -(let b 3) -(defun foo (a b) (+ a b)) +(begin defun) +(name) diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/well_formed_args.expected b/tests/unittests/resources/DiagnosticsSuite/compileTime/well_formed_args.expected index 3afc635c6..bb6a10577 100644 --- a/tests/unittests/resources/DiagnosticsSuite/compileTime/well_formed_args.expected +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/well_formed_args.expected @@ -1,5 +1,5 @@ 1 | (macro defun (let name (fun args nil))) | ^~~~ - 2 | (let foo 1) - 3 | (let a 2) + 2 | (begin defun) + 3 | (name) Expected a well formed argument(s) list, got a Symbol From 7b4003903cbdd9fadae8b6d2769c92d22d5ad3eb Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Wed, 10 Sep 2025 12:26:27 +0200 Subject: [PATCH 07/13] fix(diagnostics): correctly compute inner padding size to avoid unsigned integer underflow --- src/arkreactor/Error/Diagnostics.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/arkreactor/Error/Diagnostics.cpp b/src/arkreactor/Error/Diagnostics.cpp index 0d1d8df45..35adabd37 100644 --- a/src/arkreactor/Error/Diagnostics.cpp +++ b/src/arkreactor/Error/Diagnostics.cpp @@ -122,6 +122,11 @@ namespace Ark::Diagnostics else if (maybe_context && maybe_context->at.start.line == loc.start.line && i == loc.start.line) { const auto padding_size = std::max(1_z, maybe_context->at.start.column); + const std::string inner_padding = + // -2 to account for the │ and then â”” + (loc.start.column < padding_size || loc.start.column - padding_size < 2) + ? "" + : std::string(std::max(1_z, loc.start.column - padding_size - 1), ' '); fmt::print( os, @@ -132,10 +137,7 @@ namespace Ark::Diagnostics // indicate where the parent is, with color fmt::styled("│", colorize ? fmt::fg(fmt::color::red) : fmt::text_style()), // yet another padding of spaces between the parent and error column (if need be) - // -2 to account for the │ and then â”” - (loc.start.column - padding_size < 2) - ? "" - : std::string(loc.start.column - padding_size - 1, ' '), + inner_padding, // underline the error in red fmt::styled("└─ error", colorize ? fmt::fg(fmt::color::red) : fmt::text_style())); // new line, some spacing between the error and the parent From 642fd11b23d5f3ae142d4aedf36e58af45401b35 Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Wed, 10 Sep 2025 12:26:51 +0200 Subject: [PATCH 08/13] fix(ast lowerer): check that condition nodes have all the required parts --- src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp | 5 +++++ tests/fuzzing/fuzzer-crash-triage.py | 3 ++- .../compileTime/if_missing_cond_then.ark | 1 + .../compileTime/if_missing_cond_then.expected | 4 ++++ .../DiagnosticsSuite/compileTime/if_missing_then.ark | 5 +++++ .../compileTime/if_missing_then.expected | 10 ++++++++++ 6 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 tests/unittests/resources/DiagnosticsSuite/compileTime/if_missing_cond_then.ark create mode 100644 tests/unittests/resources/DiagnosticsSuite/compileTime/if_missing_cond_then.expected create mode 100644 tests/unittests/resources/DiagnosticsSuite/compileTime/if_missing_then.ark create mode 100644 tests/unittests/resources/DiagnosticsSuite/compileTime/if_missing_then.expected diff --git a/src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp b/src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp index e895a5431..d0cfb12e3 100644 --- a/src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp +++ b/src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp @@ -327,6 +327,11 @@ namespace Ark::internal void ASTLowerer::compileIf(Node& x, const Page p, const bool is_result_unused, const bool is_terminal) { + if (x.constList().size() == 1) + buildAndThrowError("Invalid condition: missing 'cond' and 'then' nodes, expected (if cond then)", x); + if (x.constList().size() == 2) + buildAndThrowError(fmt::format("Invalid condition: missing 'then' node, expected (if {} then)", x.constList()[1].repr()), x); + // compile condition compileExpression(x.list()[1], p, false, false); page(p).back().setSourceLocation(x.constList()[1].filename(), x.constList()[1].position().start.line); diff --git a/tests/fuzzing/fuzzer-crash-triage.py b/tests/fuzzing/fuzzer-crash-triage.py index 47b053fd0..f5f6e388a 100755 --- a/tests/fuzzing/fuzzer-crash-triage.py +++ b/tests/fuzzing/fuzzer-crash-triage.py @@ -28,7 +28,8 @@ def handle_command(i: int, count: int, file: str): if command == "o": os.rename(file, f"fct-ok/{os.path.basename(file)}.ark") elif command == "c": - os.rename(file, f"fct-bad/{os.path.basename(file)}.ark") + basename = os.path.basename(file).split(".")[0] + os.rename(file, f"fct-bad/{basename}.ark") elif command == "r": run_file(file) return True diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/if_missing_cond_then.ark b/tests/unittests/resources/DiagnosticsSuite/compileTime/if_missing_cond_then.ark new file mode 100644 index 000000000..71fc0eb4d --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/if_missing_cond_then.ark @@ -0,0 +1 @@ +(if ($if false 0) ($if false 1)) diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/if_missing_cond_then.expected b/tests/unittests/resources/DiagnosticsSuite/compileTime/if_missing_cond_then.expected new file mode 100644 index 000000000..378a1a311 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/if_missing_cond_then.expected @@ -0,0 +1,4 @@ + 1 | (if ($if false 0) ($if false 1)) + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 2 | + Invalid condition: missing 'cond' and 'then' nodes, expected (if cond then) diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/if_missing_then.ark b/tests/unittests/resources/DiagnosticsSuite/compileTime/if_missing_then.ark new file mode 100644 index 000000000..d4b60ef31 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/if_missing_then.ark @@ -0,0 +1,5 @@ +(let fi00 (fun (n) + (if (< n 2) + ($if (= "0" ($repr x)) + (fi00 (- n 2)))))) +(fi00 22) diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/if_missing_then.expected b/tests/unittests/resources/DiagnosticsSuite/compileTime/if_missing_then.expected new file mode 100644 index 000000000..80bf94c49 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/if_missing_then.expected @@ -0,0 +1,10 @@ + 1 | (let fi00 (fun (n) + 2 | (if (< n 2) + | ^~~~~~~~~~ + 3 | ($if (= "0" ($repr x)) + | ^~~~~~~~~~~~~~~~~~~~~ + 4 | (fi00 (- n 2)))))) + | ^~~~~~~~~~~~~~~ + 5 | (fi00 22) + 6 | + Invalid condition: missing 'then' node, expected (if (< n 2) then) From bfe005f7bca454ee3a0a38d3e8097f57277b5aae Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Wed, 10 Sep 2025 12:37:34 +0200 Subject: [PATCH 09/13] fix(ast lowerer): we shouldn't be able to declare a variable shadowing the function it is declared in --- CHANGELOG.md | 1 + src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp | 3 +++ .../compileTime/function_shadowing_from_inside.ark | 11 +++++++++++ .../function_shadowing_from_inside.expected | 8 ++++++++ .../RosettaSuite/count_occurrences_of_substring.ark | 6 +++--- 5 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 tests/unittests/resources/DiagnosticsSuite/compileTime/function_shadowing_from_inside.ark create mode 100644 tests/unittests/resources/DiagnosticsSuite/compileTime/function_shadowing_from_inside.expected diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a735be34..d93165f91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -155,6 +155,7 @@ - when loading a module, its mappings are loaded in the current scope instead of the global scope - argument order in the CLI changed: the file to run (and its optional script arguments) are now last, to be more consistent with all the other existing tooling (Python, Docker...) - VM stack size has been upped to 4096 + 256, to have a buffer to be able to catch stack overflows without hindering performances too much +- we can not create a variable in a function, shadowing said function, to prevent weird bugs when trying to do recursion for example ### Removed - removed unused `NodeType::Closure` diff --git a/src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp b/src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp index d0cfb12e3..96b080175 100644 --- a/src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp +++ b/src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp @@ -450,6 +450,9 @@ namespace Ark::internal const std::string name = x.constList()[1].string(); uint16_t i = addSymbol(x.constList()[1]); + if (!m_opened_vars.empty() && m_opened_vars.top() == name) + buildAndThrowError("Can not define a variable using the same name as the function it is defined inside", x); + const bool is_function = x.constList()[2].isFunction(); if (is_function) { diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/function_shadowing_from_inside.ark b/tests/unittests/resources/DiagnosticsSuite/compileTime/function_shadowing_from_inside.ark new file mode 100644 index 000000000..a9dd238be --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/function_shadowing_from_inside.ark @@ -0,0 +1,11 @@ +(mut source [1 2 0 4]) +(let n 1) + +(let foo (fun () { + (let n 1) + (let foo 5) + + (foo) + (@ source n) })) + +(foo) diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/function_shadowing_from_inside.expected b/tests/unittests/resources/DiagnosticsSuite/compileTime/function_shadowing_from_inside.expected new file mode 100644 index 000000000..61a4ba627 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/function_shadowing_from_inside.expected @@ -0,0 +1,8 @@ + 3 | + 4 | (let foo (fun () { + 5 | (let n 1) + 6 | (let foo 5) + | ^~~~~~~~~~ + 7 | + 8 | (foo) + Can not define a variable using the same name as the function it is defined inside diff --git a/tests/unittests/resources/RosettaSuite/count_occurrences_of_substring.ark b/tests/unittests/resources/RosettaSuite/count_occurrences_of_substring.ark index b82ec2488..2afb3afe6 100644 --- a/tests/unittests/resources/RosettaSuite/count_occurrences_of_substring.ark +++ b/tests/unittests/resources/RosettaSuite/count_occurrences_of_substring.ark @@ -1,12 +1,12 @@ (import std.String) (let count (fun (str word) { - (mut count 0) + (mut total 0) (mut next (string:find str word)) (while (!= -1 next) { - (set count (+ 1 count)) + (set total (+ 1 total)) (set next (string:findAfter str word (+ next (len word)))) }) - count })) + total })) (assert (= 3 (count "the three truths" "th")) "3 th in the string") (assert (= 2 (count "ababababab" "abab")) "2 abab in the string") From 83357c0e1e0cd98d5c025c61a7ef2fa5190e009d Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Wed, 10 Sep 2025 12:46:33 +0200 Subject: [PATCH 10/13] refactor(vm): marking push methods as noexcept since out of bound writes are handled in safeRun --- include/Ark/VM/VM.hpp | 6 +++--- include/Ark/VM/VM.inl | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/Ark/VM/VM.hpp b/include/Ark/VM/VM.hpp index e73268186..d768d7f7f 100644 --- a/include/Ark/VM/VM.hpp +++ b/include/Ark/VM/VM.hpp @@ -272,7 +272,7 @@ namespace Ark * @param value * @param context */ - inline void push(const Value& value, internal::ExecutionContext& context); + inline void push(const Value& value, internal::ExecutionContext& context) noexcept; /** * @brief Push a value on the stack @@ -280,7 +280,7 @@ namespace Ark * @param value * @param context */ - inline void push(Value&& value, internal::ExecutionContext& context); + inline void push(Value&& value, internal::ExecutionContext& context) noexcept; /** * @brief Push a value on the stack as a reference @@ -288,7 +288,7 @@ namespace Ark * @param valptr * @param context */ - inline void push(Value* valptr, internal::ExecutionContext& context); + inline void push(Value* valptr, internal::ExecutionContext& context) noexcept; /** * @brief Pop a value from the stack and resolve it if possible, then return it diff --git a/include/Ark/VM/VM.inl b/include/Ark/VM/VM.inl index d1ff97f23..0752f9d52 100644 --- a/include/Ark/VM/VM.inl +++ b/include/Ark/VM/VM.inl @@ -185,19 +185,19 @@ inline Value* VM::peekAndResolveAsPtr(internal::ExecutionContext& context) return &m_undefined_value; } -inline void VM::push(const Value& value, internal::ExecutionContext& context) +inline void VM::push(const Value& value, internal::ExecutionContext& context) noexcept { context.stack[context.sp] = value; ++context.sp; } -inline void VM::push(Value&& value, internal::ExecutionContext& context) +inline void VM::push(Value&& value, internal::ExecutionContext& context) noexcept { context.stack[context.sp] = std::move(value); ++context.sp; } -inline void VM::push(Value* valptr, internal::ExecutionContext& context) +inline void VM::push(Value* valptr, internal::ExecutionContext& context) noexcept { context.stack[context.sp].m_type = ValueType::Reference; context.stack[context.sp].m_value = valptr; From 1eb9b840164dedcfc6ff29e9a08d50e001db13c4 Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Wed, 10 Sep 2025 18:35:20 +0200 Subject: [PATCH 11/13] fix(macro processor): do not unify macro arguments onto other macros argument lists --- .../Compiler/Macros/Executors/Function.cpp | 13 ++++++++++--- .../compileTime/max_unification_depth.expected | 5 +---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/arkreactor/Compiler/Macros/Executors/Function.cpp b/src/arkreactor/Compiler/Macros/Executors/Function.cpp index d02b29a11..dce71ab6e 100644 --- a/src/arkreactor/Compiler/Macros/Executors/Function.cpp +++ b/src/arkreactor/Compiler/Macros/Executors/Function.cpp @@ -40,6 +40,7 @@ namespace Ark::internal // todo: this fails because we don't have a string because we are defining a (macro ! (call ...args) ...) inside another (macro ! (call ...args) ...) // most likely the first macro got applied to another macro. We shouldn't apply macro on macros + // assert(args.list()[j].nodeType() == NodeType::String || args.list()[j].nodeType() == NodeType::Spread); // todo: temp const std::string& arg_name = args.list()[j].string(); if (args.list()[j].nodeType() == NodeType::Symbol) { @@ -121,10 +122,16 @@ namespace Ark::internal "Can not define a macro by reusing the argument name `{}'", macro_name), target); - } - for (std::size_t i = 0; i < target.list().size(); ++i) - unify(map, target.list()[i], &target, i, unify_depth + 1); + // proceed for expansion only on the value of each macro + unify(map, target.list().back(), &target, target.list().size() - 1, unify_depth + 1); + } + else + { + // proceed for expansion on normal nodes, we can safely run on all subnodes + for (std::size_t i = 0; i < target.list().size(); ++i) + unify(map, target.list()[i], &target, i, unify_depth + 1); + } } else if (target.nodeType() == NodeType::Spread) { diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/max_unification_depth.expected b/tests/unittests/resources/DiagnosticsSuite/compileTime/max_unification_depth.expected index 848550a87..ce8b2dbab 100644 --- a/tests/unittests/resources/DiagnosticsSuite/compileTime/max_unification_depth.expected +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/max_unification_depth.expected @@ -6,16 +6,13 @@ 8 | (macro bloc (suffix-dup a (len defargs))) 9 | (fun (bloc) (func ...defargs bloc)) ... | - 14 | (* a b) 15 | (let inner (partial te t_func 0)) 16 | (let est_func 17 | (macro partial (func ...defargs) { - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 18 | (macro bloc (suffix-dup a (len defargs))) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 19 | (fun (bloc) (func ...defargs bloc)) - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | ^ 20 | ($undef bloc)})))) - | ^~~~~~~~~~~~~~~ 21 | Max macro unification depth reached (256). You may have a macro trying to evaluate itself, try splitting your code in multiple nodes. From 935227e747e2ce04a1f2d39f2c27e06ac6c116ab Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Wed, 10 Sep 2025 18:41:31 +0200 Subject: [PATCH 12/13] fix(diagnostics): do not print an additional '^' under nothing --- src/arkreactor/Error/Diagnostics.cpp | 9 +++++++-- src/arkreactor/Error/PrettyPrinting.cpp | 2 ++ .../compileTime/invalid_node_multilines.expected | 1 - .../compileTime/macro_shadowing_args.expected | 1 - .../compileTime/max_unification_depth.expected | 1 - 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/arkreactor/Error/Diagnostics.cpp b/src/arkreactor/Error/Diagnostics.cpp index 35adabd37..d6e974401 100644 --- a/src/arkreactor/Error/Diagnostics.cpp +++ b/src/arkreactor/Error/Diagnostics.cpp @@ -96,8 +96,6 @@ namespace Ark::Diagnostics // show where the error occurred if (source_printer.isTargetLine() && !line.empty()) { - fmt::print(os, "{}", Printer::GhostLinePrefix); - if (!loc.wholeLineIsError()) { const std::size_t line_first_char = (line.find_first_not_of(" \t\v") == std::string::npos) ? 0 : line.find_first_not_of(" \t\v"); @@ -106,6 +104,11 @@ namespace Ark::Diagnostics // due to the `!loc.wholeLineIsError()` check, we are guaranteed to have a value in loc.end const std::size_t col_end = (i == loc.end->line) ? loc.end->column : line.size(); + // ignore the last line that is sometimes erroneous in multiline contexts + if (i == loc.end->line && loc.end->line != loc.start.line && col_start >= col_end) + continue; + fmt::print(os, "{}", Printer::GhostLinePrefix); + // show the error where it's at, using the normal process, if there is no context OR // if the context line is different from the error line if (!maybe_context || maybe_context->at.start.line != loc.start.line) @@ -162,6 +165,8 @@ namespace Ark::Diagnostics } else { + fmt::print(os, "{}", Printer::GhostLinePrefix); + // first non-whitespace character of the line // +1 for the leading whitespace after ` |` before the code const std::size_t col_start = line.find_first_not_of(" \t\v") + 1; diff --git a/src/arkreactor/Error/PrettyPrinting.cpp b/src/arkreactor/Error/PrettyPrinting.cpp index 228daa257..e15be11ee 100644 --- a/src/arkreactor/Error/PrettyPrinting.cpp +++ b/src/arkreactor/Error/PrettyPrinting.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -124,6 +125,7 @@ namespace Ark::Diagnostics m_window.skip_start_at = line_to_include + 3; m_window.resume_at = m_window.start; + assert(line_to_include <= m_window.start && "line_to_include has to be before the start of our base context, source of errors are always before our errors"); // due to how context works, if it points to the same file, // we are guaranteed it will be before our error m_window.start = line_to_include >= 3 ? line_to_include - 3 : 0; diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/invalid_node_multilines.expected b/tests/unittests/resources/DiagnosticsSuite/compileTime/invalid_node_multilines.expected index d41d394b8..c72a5b69c 100644 --- a/tests/unittests/resources/DiagnosticsSuite/compileTime/invalid_node_multilines.expected +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/invalid_node_multilines.expected @@ -3,6 +3,5 @@ 2 | 80000000000000000 | ^~~~~~~~~~~~~~~~ 3 | ( - | ^ 4 | invalid syntax, expected node diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_shadowing_args.expected b/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_shadowing_args.expected index d3a6a86b6..012762c9b 100644 --- a/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_shadowing_args.expected +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/macro_shadowing_args.expected @@ -3,7 +3,6 @@ 2 | (macro all_args 5) | ^~~~~~~~~~~~~~~~~ 3 | (fun (arg_bloc) (call all_args)) }) - | ^ 4 | 5 | (let foo (fun (a b c d) ())) Can not define a macro by reusing the argument name `all_args' diff --git a/tests/unittests/resources/DiagnosticsSuite/compileTime/max_unification_depth.expected b/tests/unittests/resources/DiagnosticsSuite/compileTime/max_unification_depth.expected index ce8b2dbab..8e5e94cf2 100644 --- a/tests/unittests/resources/DiagnosticsSuite/compileTime/max_unification_depth.expected +++ b/tests/unittests/resources/DiagnosticsSuite/compileTime/max_unification_depth.expected @@ -12,7 +12,6 @@ 18 | (macro bloc (suffix-dup a (len defargs))) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 19 | (fun (bloc) (func ...defargs bloc)) - | ^ 20 | ($undef bloc)})))) 21 | Max macro unification depth reached (256). You may have a macro trying to evaluate itself, try splitting your code in multiple nodes. From 3e7259ce700fb95101b5f521cf0ba29a0c86455b Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Wed, 10 Sep 2025 18:54:37 +0200 Subject: [PATCH 13/13] feat(vm, tests): improving the stack overflow error message, and adding proper tests for it --- src/arkreactor/VM/VM.cpp | 29 +++++---- .../runtime/stackoverflow_page_0.ark | 65 +++++++++++++++++++ .../runtime/stackoverflow_page_0.expected | 7 ++ .../runtime/stackoverflow_recur.ark | 9 +++ .../runtime/stackoverflow_recur.expected | 15 +++++ 5 files changed, 112 insertions(+), 13 deletions(-) create mode 100644 tests/unittests/resources/DiagnosticsSuite/runtime/stackoverflow_page_0.ark create mode 100644 tests/unittests/resources/DiagnosticsSuite/runtime/stackoverflow_page_0.expected create mode 100644 tests/unittests/resources/DiagnosticsSuite/runtime/stackoverflow_recur.ark create mode 100644 tests/unittests/resources/DiagnosticsSuite/runtime/stackoverflow_recur.expected diff --git a/src/arkreactor/VM/VM.cpp b/src/arkreactor/VM/VM.cpp index 9bab0646c..ec9780b20 100644 --- a/src/arkreactor/VM/VM.cpp +++ b/src/arkreactor/VM/VM.cpp @@ -505,19 +505,22 @@ namespace Ark # define GOTO_HALT() break #endif -#define NEXTOPARG() \ - do \ - { \ - inst = m_state.inst(context.pp, context.ip); \ - padding = m_state.inst(context.pp, context.ip + 1); \ - arg = static_cast((m_state.inst(context.pp, context.ip + 2) << 8) + \ - m_state.inst(context.pp, context.ip + 3)); \ - context.ip += 4; \ - context.inst_exec_counter = (context.inst_exec_counter + 1) % VMOverflowBufferSize; \ - if (context.inst_exec_counter < 2 && context.sp >= VMStackSize) \ - { \ - throw Error("Stack overflow"); \ - } \ +#define NEXTOPARG() \ + do \ + { \ + inst = m_state.inst(context.pp, context.ip); \ + padding = m_state.inst(context.pp, context.ip + 1); \ + arg = static_cast((m_state.inst(context.pp, context.ip + 2) << 8) + \ + m_state.inst(context.pp, context.ip + 3)); \ + context.ip += 4; \ + context.inst_exec_counter = (context.inst_exec_counter + 1) % VMOverflowBufferSize; \ + if (context.inst_exec_counter < 2 && context.sp >= VMStackSize) \ + { \ + if (context.pp != 0) \ + throw Error("Stack overflow. You could consider rewriting your function to make use of tail-call optimization."); \ + else \ + throw Error("Stack overflow. Are you trying to call a function with too many arguments?"); \ + } \ } while (false) #define DISPATCH() \ NEXTOPARG(); \ diff --git a/tests/unittests/resources/DiagnosticsSuite/runtime/stackoverflow_page_0.ark b/tests/unittests/resources/DiagnosticsSuite/runtime/stackoverflow_page_0.ark new file mode 100644 index 000000000..46a95155a --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/runtime/stackoverflow_page_0.ark @@ -0,0 +1,65 @@ +(append [] + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1) diff --git a/tests/unittests/resources/DiagnosticsSuite/runtime/stackoverflow_page_0.expected b/tests/unittests/resources/DiagnosticsSuite/runtime/stackoverflow_page_0.expected new file mode 100644 index 000000000..6dc0f2090 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/runtime/stackoverflow_page_0.expected @@ -0,0 +1,7 @@ +Stack overflow. Are you trying to call a function with too many arguments? + +In file tests/unittests/resources/DiagnosticsSuite/runtime/stackoverflow_page_0.ark:1 + 1 | (append [] + | ^~~~~~~~~ + 2 | 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 3 | 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/tests/unittests/resources/DiagnosticsSuite/runtime/stackoverflow_recur.ark b/tests/unittests/resources/DiagnosticsSuite/runtime/stackoverflow_recur.ark new file mode 100644 index 000000000..e94097637 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/runtime/stackoverflow_recur.ark @@ -0,0 +1,9 @@ +(let A (fun (k x1 x0 x3 x4 x5) { + (let B (fun () { + (set k (- k 1)) + (B k A x1 x0 x3 x4) })) + (if (<= k 0) + (+ (x4) (x5)) + (B)) })) + +(A 9 (fun () 0) (fun () -1) (fun () -1) (fun () 0) (fun () 0)) diff --git a/tests/unittests/resources/DiagnosticsSuite/runtime/stackoverflow_recur.expected b/tests/unittests/resources/DiagnosticsSuite/runtime/stackoverflow_recur.expected new file mode 100644 index 000000000..13432f626 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/runtime/stackoverflow_recur.expected @@ -0,0 +1,15 @@ +Stack overflow. You could consider rewriting your function to make use of tail-call optimization. + +In file tests/unittests/resources/DiagnosticsSuite/runtime/stackoverflow_recur.ark:3 + 1 | (let A (fun (k x1 x0 x3 x4 x5) { + 2 | (let B (fun () { + 3 | (set k (- k 1)) + | ^~~~~~~~~~~~~~ + 4 | (B k A x1 x0 x3 x4) })) + 5 | (if (<= k 0) + +[ 3] In function `B' (tests/unittests/resources/DiagnosticsSuite/runtime/stackoverflow_recur.ark:3) +[ 2] In function `A' (tests/unittests/resources/DiagnosticsSuite/runtime/stackoverflow_recur.ark:7) +[ 1] In global scope (tests/unittests/resources/DiagnosticsSuite/runtime/stackoverflow_recur.ark:9) + +Current scope variables values: