mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-18 15:31:32 +03:00
fix macros tests
This commit is contained in:
parent
63342e7b10
commit
d4eae685a3
@ -1,4 +1,4 @@
|
||||
use crate::{get_error, get_output, parse_program};
|
||||
use crate::{assert_satisfied, expect_compiler_error, generate_main_inputs, parse_program};
|
||||
use leo_types::InputValue;
|
||||
|
||||
#[test]
|
||||
@ -6,7 +6,7 @@ fn test_print() {
|
||||
let bytes = include_bytes!("print.leo");
|
||||
let program = parse_program(bytes).unwrap();
|
||||
|
||||
let _output = get_output(program);
|
||||
assert_satisfied(program);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -21,7 +21,7 @@ fn test_print_parameter() {
|
||||
let bytes = include_bytes!("print_parameter.leo");
|
||||
let program = parse_program(bytes).unwrap();
|
||||
|
||||
let _output = get_output(program);
|
||||
assert_satisfied(program);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -29,7 +29,7 @@ fn test_print_parameter_many() {
|
||||
let bytes = include_bytes!("print_parameter_many.leo");
|
||||
let program = parse_program(bytes).unwrap();
|
||||
|
||||
let _output = get_output(program);
|
||||
assert_satisfied(program);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -37,7 +37,7 @@ fn test_print_parameter_fail_unknown() {
|
||||
let bytes = include_bytes!("print_parameter_fail_unknown.leo");
|
||||
let program = parse_program(bytes).unwrap();
|
||||
|
||||
let _err = get_error(program);
|
||||
expect_compiler_error(program);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -45,7 +45,7 @@ fn test_print_parameter_fail_empty() {
|
||||
let bytes = include_bytes!("print_parameter_fail_empty.leo");
|
||||
let program = parse_program(bytes).unwrap();
|
||||
|
||||
let _err = get_error(program);
|
||||
expect_compiler_error(program);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -53,7 +53,7 @@ fn test_print_parameter_fail_none() {
|
||||
let bytes = include_bytes!("print_parameter_fail_empty.leo");
|
||||
let program = parse_program(bytes).unwrap();
|
||||
|
||||
let _err = get_error(program);
|
||||
expect_compiler_error(program);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -61,9 +61,11 @@ fn test_print_input() {
|
||||
let bytes = include_bytes!("print_input.leo");
|
||||
let mut program = parse_program(bytes).unwrap();
|
||||
|
||||
program.set_main_inputs(vec![Some(InputValue::Boolean(true))]);
|
||||
let main_inputs = generate_main_inputs(vec![("a", Some(InputValue::Boolean(true)))]);
|
||||
|
||||
let _output = get_output(program);
|
||||
program.set_main_inputs(main_inputs);
|
||||
|
||||
assert_satisfied(program);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -71,12 +73,13 @@ fn test_debug() {
|
||||
let bytes = include_bytes!("debug.leo");
|
||||
let program = parse_program(bytes).unwrap();
|
||||
|
||||
let _output = get_output(program);
|
||||
assert_satisfied(program);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_error() {
|
||||
let bytes = include_bytes!("error.leo");
|
||||
let program = parse_program(bytes).unwrap();
|
||||
|
||||
let _output = get_output(program);
|
||||
assert_satisfied(program);
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
function main(b: bool) {
|
||||
print!("b = {}", b);
|
||||
function main(a: bool) {
|
||||
print!("a = {}", a);
|
||||
}
|
@ -8,7 +8,7 @@ pub mod group;
|
||||
pub mod import;
|
||||
pub mod inputs;
|
||||
pub mod integers;
|
||||
// pub mod macros;
|
||||
pub mod macros;
|
||||
// pub mod mutability;
|
||||
// pub mod statements;
|
||||
// pub mod syntax;
|
||||
|
Loading…
Reference in New Issue
Block a user