Add tests for using LocatorExpression out of place

This commit is contained in:
evan-schott 2024-03-29 10:54:48 -07:00
parent 1434e0a610
commit ed085666a3
5 changed files with 43 additions and 1 deletions

View File

@ -17,7 +17,7 @@
use super::*;
use leo_errors::{ParserError, Result};
use leo_span::{sym, Symbol};
use leo_span::sym;
use snarkvm::console::{account::Address, network::Testnet3};
const INT_TYPES: &[Token] = &[

View File

@ -0,0 +1,5 @@
---
namespace: Compile
expectation: Fail
outputs:
- "Error [ETYC0372005]: Unknown variable `users`\n --> compiler-test:7:22\n |\n 7 | let a: u32 = relay.aleo/users;\n | ^^^^^^^^^^^^^^^^\nError [ETYC0372005]: Unknown variable `users`\n --> compiler-test:11:35\n |\n 11 | let a:bool = Mapping::get(relay.aleo/users, addr);\n | ^^^^^^^^^^^^^^^^\n"

View File

@ -0,0 +1,5 @@
---
namespace: Parse
expectation: Fail
outputs:
- "Error [EPAR0370005]: expected 'address', 'bool', 'field', 'group', 'scalar', 'signature', 'string', 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128' -- found 'mapping'\n --> test:7:16\n |\n 7 | let a: mapping = relay.aleo/users;\n | ^^^^^^^"

View File

@ -0,0 +1,16 @@
/*
namespace: Compile
expectation: Fail
*/
program relay.aleo {
mapping users: address => bool;
transition send(addr: address) {
let a: u32 = relay.aleo/users;
return then finalize(addr);
}
finalize send(addr: address) {
let a:bool = Mapping::get(relay.aleo/users, addr);
}
}

View File

@ -0,0 +1,16 @@
/*
namespace: Parse
expectation: Fail
*/
program relay.aleo {
mapping users: address => bool;
transition send(addr: address) {
let a: mapping = relay.aleo/users;
return then finalize(addr);
}
finalize send(addr: address) {
let a:bool = Mapping::get(relay.aleo/users, addr);
}
}