mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-23 10:12:21 +03:00
fix tests
This commit is contained in:
parent
3de2d3f563
commit
52141fea68
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [ETYC0372064]: A `function` cannot output a record.\n --> compiler-test:9:45\n |\n 9 | function foo(board: Board, data: u8) -> Board {\n | ^^^^^\n"
|
||||
- "Error [ETYC0372064]: A `function` cannot have a record as input or output.\n --> compiler-test:9:18\n |\n 9 | function foo(board: Board, data: u8) -> Board {\n | ^^^^^\nError [ETYC0372064]: A `function` cannot have a record as input or output.\n --> compiler-test:9:45\n |\n 9 | function foo(board: Board, data: u8) -> Board {\n | ^^^^^\nError [ETYC0372064]: A `function` cannot have a record as input or output.\n --> compiler-test:16:18\n |\n 16 | function bar(board: Board) {\n | ^^^^^\n"
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [ETYC0372064]: A `function` cannot output a record.\n --> compiler-test:11:44\n |\n 11 | function mint(r0: address, r1: u64) -> Token {\n | ^^^^^\nError [ETYC0372003]: Expected type `address` but type `u64` was found\n --> compiler-test:13:20\n |\n 13 | owner: r1, // This variable should be type address.\n | ^^\nError [ETYC0372003]: Expected type `u64` but type `address` was found\n --> compiler-test:14:21\n |\n 14 | amount: r0, // This variable should be type u64.\n | ^^\nError [ETYC0372047]: Only `inline` can be called from a `function` or `inline`.\n --> compiler-test:20:24\n |\n 20 | let t: Token = mint(x, c);\n | ^^^^^^^^^^\n"
|
||||
- "Error [ETYC0372064]: A `function` cannot have a record as input or output.\n --> compiler-test:11:44\n |\n 11 | function mint(r0: address, r1: u64) -> Token {\n | ^^^^^\nError [ETYC0372003]: Expected type `address` but type `u64` was found\n --> compiler-test:13:20\n |\n 13 | owner: r1, // This variable should be type address.\n | ^^\nError [ETYC0372003]: Expected type `u64` but type `address` was found\n --> compiler-test:14:21\n |\n 14 | amount: r0, // This variable should be type u64.\n | ^^\nError [ETYC0372047]: Only `inline` can be called from a `function` or `inline`.\n --> compiler-test:20:24\n |\n 20 | let t: Token = mint(x, c);\n | ^^^^^^^^^^\n"
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [ETYC0372064]: A `function` cannot output a record.\n --> compiler-test:11:44\n |\n 11 | function mint(r0: address, r1: u64) -> Token {\n | ^^^^^\nError [ETYC0372013]: Struct initialization expression for `Token` is missing member `owner`.\n --> compiler-test:12:16\n |\n 12 | return Token {\n 13 | sender: r0, // This variable should be named `owner`.\n 14 | amount: r1,\n 15 | };\n | ^^^^^^\nError [ETYC0372047]: Only `inline` can be called from a `function` or `inline`.\n --> compiler-test:20:24\n |\n 20 | let t: Token = mint(x, c);\n | ^^^^^^^^^^\n"
|
||||
- "Error [ETYC0372064]: A `function` cannot have a record as input or output.\n --> compiler-test:11:44\n |\n 11 | function mint(r0: address, r1: u64) -> Token {\n | ^^^^^\nError [ETYC0372013]: Struct initialization expression for `Token` is missing member `owner`.\n --> compiler-test:12:16\n |\n 12 | return Token {\n 13 | sender: r0, // This variable should be named `owner`.\n 14 | amount: r1,\n 15 | };\n | ^^^^^^\nError [ETYC0372047]: Only `inline` can be called from a `function` or `inline`.\n --> compiler-test:20:24\n |\n 20 | let t: Token = mint(x, c);\n | ^^^^^^^^^^\n"
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EAST0372007]: struct `s1` shadowed by\n --> compiler-test:9:5\n |\n 9 | struct s1 {\n 10 | f1: u32,\n 11 | f2: u32,\n 12 | f3: u32\n 13 | }\n | ^\n"
|
||||
- "Error [EAST0372015]: There are two mismatched definitions of struct `s1`.\n |\n = Duplicate definitions of structs are required to use external structs, but each field's name and type must match exactly.\n"
|
||||
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
program test.aleo {
|
||||
struct message {
|
||||
sender: u8,
|
||||
object: u8,
|
||||
}
|
||||
mapping balances: u8 => u8;
|
||||
|
||||
transition a(arg1: message) -> message {
|
||||
return message {
|
||||
sender: 1u8,
|
||||
object: 1u8,
|
||||
};
|
||||
}
|
||||
|
||||
function b(arg1: message) -> message {
|
||||
return message {
|
||||
sender: 1u8,
|
||||
object: 1u8,
|
||||
};
|
||||
}
|
||||
|
||||
function c(arg1: balances) -> balances {
|
||||
return arg1;
|
||||
}
|
||||
|
||||
transition d(arg1: balances) -> balances {
|
||||
return arg1;
|
||||
}
|
||||
}
|
@ -90,9 +90,7 @@ mod tests {
|
||||
create_session_if_not_set_then(|_| {
|
||||
let program_from_file =
|
||||
fs::read_to_string("../tmp/.aleo/registry/testnet3/zk_bitwise_stack_v0_0_2.aleo").unwrap();
|
||||
dbg!(program_from_file.clone());
|
||||
let program = disassemble_from_str(program_from_file).unwrap();
|
||||
dbg!(program);
|
||||
let _program = disassemble_from_str(program_from_file).unwrap();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user