add type fail tests

This commit is contained in:
collin 2020-09-02 11:40:58 -07:00
parent 8cf5eb8790
commit f286ba241d
3 changed files with 23 additions and 0 deletions

View File

@ -126,3 +126,19 @@ fn test_multi() {
assert_satisfied(program);
}
#[test]
fn test_multi_initializer_fail() {
let program_bytes = include_bytes!("multi_fail_initializer.leo");
let program = parse_program(program_bytes).unwrap();
expect_compiler_error(program);
}
#[test]
fn test_multi_inline_fail() {
let program_bytes = include_bytes!("multi_fail_inline.leo");
let program = parse_program(program_bytes).unwrap();
expect_compiler_error(program);
}

View File

@ -0,0 +1,3 @@
function main() {
let arr: [u8; (2, 2)] = [[1u8; 2]; 1]; // incorrect dimensions
}

View File

@ -0,0 +1,4 @@
function main() {
let arr: [u8; (2, 2)] = [[1u8, 1u8],
[1u8]]; // incorrect dimensions
}