mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-23 15:15:47 +03:00
633: duplicate name context test r=collinc97 a=gluax Adding a test for duplicate name context that was resolved in #546. 634: fn call array params r=collinc97 a=gluax Adding a test for bug #522, which was resolved by the asg. Closes #522 Co-authored-by: gluaxspeed <jonathan.t.pavlik@gmail.com>
This commit is contained in:
commit
a3f0f9d587
13
compiler/tests/circuits/duplicate_name_context.leo
Normal file
13
compiler/tests/circuits/duplicate_name_context.leo
Normal file
@ -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);
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
9
compiler/tests/function/array_params_direct_call.leo
Normal file
9
compiler/tests/function/array_params_direct_call.leo
Normal file
@ -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..]);
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user