another test

This commit is contained in:
gluax 2021-03-25 16:52:43 -04:00
parent 0240ea27e5
commit c78ab699b8
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,13 @@
circuit Foo {
a: u8,
function use_a(const self) -> u8 {
return self.a + 1
}
}
function main() {
let f = Foo { a: 0u8 };
console.assert(1u8 == f.use_a());
}

View File

@ -133,6 +133,14 @@ fn test_member_static_function_undefined() {
} }
// Constant // Constant
#[test]
fn test_const_self_variable() {
let program_string = include_str!("const_self_variable.leo");
let program = parse_program(program_string).unwrap();
assert_satisfied(program);
}
#[test] #[test]
fn test_const_self_variable_fail() { fn test_const_self_variable_fail() {
let program_string = include_str!("const_self_variable_fail.leo"); let program_string = include_str!("const_self_variable_fail.leo");