kkrt-labs / cairo-vm-ts

A typescript implementation of the Cairo VM
Apache License 2.0
20 stars 13 forks source link

test: add more Cairo programs #86

Closed zmalatrax closed 5 months ago

zmalatrax commented 5 months ago

Now that all builtins have been implemented, we should make the test suite more extensive. The hints haven't been implemented yet, so we limit this to programs which doesn't require hints

zmalatrax commented 5 months ago

List of all Cairo programs in [cairo-vm]() found with the jq: find ./cairo-vm/cairo_programs -type f -name "*.json" -exec sh -c 'jq ".hints | length == 0" "$1" | grep -q true && echo "$1"' _ {} \; > cairo-vm-no-hint-programs.txt:

./cairo-vm/cairo_programs/not_main.json
./cairo-vm/cairo_programs/fibonacci.json
./cairo-vm/cairo_programs/poseidon_builtin.json
./cairo-vm/cairo_programs/if_in_function.json
./cairo-vm/cairo_programs/if_list.json
./cairo-vm/cairo_programs/simple_print.json
./cairo-vm/cairo_programs/pointers.json
./cairo-vm/cairo_programs/reversed_register_instructions.json
./cairo-vm/cairo_programs/function_return_if_print.json
./cairo-vm/cairo_programs/integration_with_alloc_locals.json
./cairo-vm/cairo_programs/pedersen_test.json
./cairo-vm/cairo_programs/factorial.json
./cairo-vm/cairo_programs/test_subtraction_if.json
./cairo-vm/cairo_programs/integration.json
./cairo-vm/cairo_programs/jmp_if_condition.json
./cairo-vm/cairo_programs/jmp.json
./cairo-vm/cairo_programs/test_reverse_if.json
./cairo-vm/cairo_programs/function_return_to_variable.json
./cairo-vm/cairo_programs/big_struct.json
./cairo-vm/cairo_programs/function_return.json
./cairo-vm/cairo_programs/struct.json
./cairo-vm/cairo_programs/bitwise_output.json
./cairo-vm/cairo_programs/if_and_prime.json
./cairo-vm/cairo_programs/multiplicative_inverse.json
./cairo-vm/cairo_programs/bitwise_builtin_test.json
./cairo-vm/cairo_programs/keccak_builtin.json
./cairo-vm/cairo_programs/print.json
./cairo-vm/cairo_programs/bitwise_recursion.json
./cairo-vm/cairo_programs/test_addition_if.json
./cairo-vm/cairo_programs/memory_holes.json
./cairo-vm/cairo_programs/return.json
./cairo-vm/cairo_programs/call_function_assign_param_by_name.json

./cairo-vm/cairo_programs/benchmarks/big_fibonacci.json
./cairo-vm/cairo_programs/benchmarks/integration_builtins.json
./cairo-vm/cairo_programs/benchmarks/pedersen.json
./cairo-vm/cairo_programs/benchmarks/big_factorial.json

./cairo-vm/cairo_programs/bad_programs/error_msg_attr.json
./cairo-vm/cairo_programs/bad_programs/error_msg_function.json
./cairo-vm/cairo_programs/bad_programs/error_msg_attr_tempvar.json
./cairo-vm/cairo_programs/bad_programs/bad_range_check.json

./cairo-vm/cairo_programs/manually_compiled/overflowing_dict.json
./cairo-vm/cairo_programs/manually_compiled/no_data_program.json
./cairo-vm/cairo_programs/manually_compiled/invalid_even_length_hex.json
./cairo-vm/cairo_programs/manually_compiled/valid_program_b.json
./cairo-vm/cairo_programs/manually_compiled/no_main_program.json
./cairo-vm/cairo_programs/manually_compiled/invalid_memory.json
./cairo-vm/cairo_programs/manually_compiled/invalid_odd_length_hex.json
./cairo-vm/cairo_programs/manually_compiled/deserialize_constant_test.json

No need to import the manually compiled programs to the test suite imo The other contracts should be imported (might prune a few programs if not that relevant)