mirror of
https://github.com/AleoHQ/leo.git
synced 2024-11-28 11:16:49 +03:00
test for bug
This commit is contained in:
parent
952ce8c17e
commit
f44dcc1e96
@ -308,3 +308,11 @@ fn test_duplicate_name_context() {
|
||||
|
||||
assert_satisfied(program);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_mutable_call_immutable_context() {
|
||||
let program_string = include_str!("mutable_call_immutable_context.leo");
|
||||
let program = parse_program(program_string).unwrap();
|
||||
|
||||
assert_satisfied(program);
|
||||
}
|
||||
|
12
compiler/tests/circuits/mutable_call_immutable_context.leo
Normal file
12
compiler/tests/circuits/mutable_call_immutable_context.leo
Normal file
@ -0,0 +1,12 @@
|
||||
circuit TestMe {
|
||||
x: u8,
|
||||
|
||||
function test_me(mut self) -> u8 {
|
||||
self.x += 1;
|
||||
return self.x
|
||||
}
|
||||
}
|
||||
|
||||
function main () {
|
||||
const t = TestMe {x: 6u8}.test_me();
|
||||
}
|
Loading…
Reference in New Issue
Block a user