diff --git a/compiler/tests/circuits/duplicate_name_context.leo b/compiler/tests/circuits/duplicate_name_context.leo new file mode 100644 index 0000000000..4fe20a12e8 --- /dev/null +++ b/compiler/tests/circuits/duplicate_name_context.leo @@ -0,0 +1,13 @@ +circuit Bar { + b2: u32 + + function add_five(z:u32) -> u32 { + return z+5u32 + } +} + +function main () { + let Bar = 66u32; + const k1 = Bar{ b2: 30u32 }; + const k2 = Bar::add_five(55u32); +} \ No newline at end of file diff --git a/compiler/tests/circuits/mod.rs b/compiler/tests/circuits/mod.rs index 488b639d0b..3fe4b54955 100644 --- a/compiler/tests/circuits/mod.rs +++ b/compiler/tests/circuits/mod.rs @@ -283,3 +283,11 @@ fn test_define_circuit_inside_circuit_function() { assert_satisfied(program); } + +#[test] +fn test_duplicate_name_context() { + let program_string = include_str!("duplicate_name_context.leo"); + let program = parse_program(program_string).unwrap(); + + assert_satisfied(program); +} diff --git a/compiler/tests/function/array_params_direct_call.leo b/compiler/tests/function/array_params_direct_call.leo new file mode 100644 index 0000000000..9305b0958d --- /dev/null +++ b/compiler/tests/function/array_params_direct_call.leo @@ -0,0 +1,9 @@ +function do_nothing(arr: [u32; 2]) {} + +function main() { + let arr: [u32; 2] = [0; 2]; + + do_nothing(arr); + do_nothing([...arr]); + do_nothing(arr[1u32..]); +} \ No newline at end of file diff --git a/compiler/tests/function/mod.rs b/compiler/tests/function/mod.rs index f7bf4ed3db..6de6cd8153 100644 --- a/compiler/tests/function/mod.rs +++ b/compiler/tests/function/mod.rs @@ -203,3 +203,11 @@ fn test_return_tuple_conditional() { assert_satisfied(program); } + +#[test] +fn test_array_params_direct_call() { + let program_string = include_str!("array_params_direct_call.leo"); + let program = parse_program(program_string).unwrap(); + + assert_satisfied(program); +}