add inline circuit integration tests

This commit is contained in:
collin 2021-02-04 13:18:28 -08:00
parent cd5811dfd6
commit f5be2e037f
3 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,8 @@
circuit Foo {
x: u8
}
function main() {
let y: u8 = 1;
let a = Foo { y };
}

View File

@ -0,0 +1,13 @@
circuit Foo {
x: u8
function new(x: u8) -> Self {
return Self { x }
}
}
function main() {
let x: u8 = 1;
let a = Foo { x };
let b = Foo::new(x);
}

View File

@ -248,6 +248,24 @@ fn test_self_member_undefined() {
expect_asg_error(error);
}
// Inline circuit member
#[test]
fn test_inline_member_pass() {
let program_string = include_str!("inline_member_pass.leo");
let program = parse_program(program_string).unwrap();
assert_satisfied(program);
}
#[test]
fn test_inline_member_fail() {
let program_string = include_str!("inline_member_fail.leo");
let error = parse_program(program_string).err().unwrap();
expect_asg_error(error);
}
// All
#[test]