Skip to content

Commit

Permalink
test program output array registers
Browse files Browse the repository at this point in the history
  • Loading branch information
collinc97 committed Jan 12, 2021
1 parent 9215d91 commit f3452b9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/tests/input_files/program_registers/input/array.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[registers]
r2: [[u8; 4]; 2] = [[0u64, 0u64, 0u64, 0u64], [0u64, 0u64, 0u64, 0u64]];
13 changes: 13 additions & 0 deletions compiler/tests/input_files/program_registers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,16 @@ fn test_registers_fail() {

expect_compiler_error(program);
}

#[test]
fn test_registers_array() {
let program_string = include_str!("registers_array.leo");
let input_string = include_str!("input/array.in");
let expected = include_bytes!("output/registers_array.out");

let program = parse_program_with_input(program_string, input_string).unwrap();

let actual = get_output(program);

assert!(expected.eq(actual.bytes().as_slice()));
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[registers]
r2: [[u8; 4]; 2] = [[1, 2, 3, 4], [5, 6, 7, 8]];
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function main () -> [[u8; 4]; 2] {
return [[1u8, 2u8, 3u8, 4u8], [5u8, 6u8, 7u8, 8u8]]
}

0 comments on commit f3452b9

Please sign in to comment.