mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-24 18:52:58 +03:00
impl tests for group notation
This commit is contained in:
parent
3fe25da23f
commit
37bedc8662
3
compiler/tests/group/double_high.leo
Normal file
3
compiler/tests/group/double_high.leo
Normal file
@ -0,0 +1,3 @@
|
||||
function main() {
|
||||
let element = (+, +)group;
|
||||
}
|
3
compiler/tests/group/double_inferred.leo
Normal file
3
compiler/tests/group/double_inferred.leo
Normal file
@ -0,0 +1,3 @@
|
||||
function main() {
|
||||
let element = (_, _)group;
|
||||
}
|
3
compiler/tests/group/double_low.leo
Normal file
3
compiler/tests/group/double_low.leo
Normal file
@ -0,0 +1,3 @@
|
||||
function main() {
|
||||
let element = (-, -)group;
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
use crate::{
|
||||
assert_satisfied,
|
||||
expect_compiler_error,
|
||||
expect_synthesis_error,
|
||||
field::field_to_decimal_string,
|
||||
generate_main_input,
|
||||
@ -20,22 +21,6 @@ pub fn group_to_decimal_string(g: EdwardsAffine) -> String {
|
||||
format!("({}, {})", x, y)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_zero() {
|
||||
let bytes = include_bytes!("zero.leo");
|
||||
let program = parse_program(bytes).unwrap();
|
||||
|
||||
assert_satisfied(program);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_one() {
|
||||
let bytes = include_bytes!("one.leo");
|
||||
let program = parse_program(bytes).unwrap();
|
||||
|
||||
assert_satisfied(program)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_point() {
|
||||
let bytes = include_bytes!("point.leo");
|
||||
@ -44,6 +29,81 @@ fn test_point() {
|
||||
assert_satisfied(program);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_x_sign_high() {
|
||||
let bytes = include_bytes!("x_sign_high.leo");
|
||||
let program = parse_program(bytes).unwrap();
|
||||
|
||||
assert_satisfied(program);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_x_sign_low() {
|
||||
let bytes = include_bytes!("x_sign_low.leo");
|
||||
let program = parse_program(bytes).unwrap();
|
||||
|
||||
assert_satisfied(program);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_x_sign_inferred() {
|
||||
let bytes = include_bytes!("x_sign_inferred.leo");
|
||||
let program = parse_program(bytes).unwrap();
|
||||
|
||||
assert_satisfied(program);
|
||||
}
|
||||
|
||||
// #[test]
|
||||
// fn test_y_sign_high() {
|
||||
// let bytes = include_bytes!("y_sign_high.leo");
|
||||
// let program = parse_program(bytes).unwrap();
|
||||
//
|
||||
// assert_satisfied(program);
|
||||
// }
|
||||
//
|
||||
// #[test]
|
||||
// fn test_y_sign_low() {
|
||||
// let bytes = include_bytes!("y_sign_low.leo");
|
||||
// let program = parse_program(bytes).unwrap();
|
||||
//
|
||||
// assert_satisfied(program);
|
||||
// }
|
||||
//
|
||||
// #[test]
|
||||
// fn test_y_sign_inferred() {
|
||||
// let bytes = include_bytes!("y_sign_inferred.leo");
|
||||
// let program = parse_program(bytes).unwrap();
|
||||
//
|
||||
// assert_satisfied(program);
|
||||
// }
|
||||
|
||||
#[test]
|
||||
fn test_double_high() {
|
||||
let bytes = include_bytes!("double_high.leo");
|
||||
|
||||
let program = parse_program(bytes).unwrap();
|
||||
|
||||
expect_compiler_error(program);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_double_low() {
|
||||
let bytes = include_bytes!("double_low.leo");
|
||||
|
||||
let program = parse_program(bytes).unwrap();
|
||||
|
||||
expect_compiler_error(program);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_double_inferred() {
|
||||
let bytes = include_bytes!("double_inferred.leo");
|
||||
|
||||
let program = parse_program(bytes).unwrap();
|
||||
|
||||
expect_compiler_error(program);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_point_input() {
|
||||
let program_bytes = include_bytes!("point_input.leo");
|
||||
|
@ -1,3 +0,0 @@
|
||||
function main() {
|
||||
let a = 1group;
|
||||
}
|
3
compiler/tests/group/x_sign_high.leo
Normal file
3
compiler/tests/group/x_sign_high.leo
Normal file
@ -0,0 +1,3 @@
|
||||
function main() {
|
||||
let element = (0, +)group;
|
||||
}
|
3
compiler/tests/group/x_sign_inferred.leo
Normal file
3
compiler/tests/group/x_sign_inferred.leo
Normal file
@ -0,0 +1,3 @@
|
||||
function main() {
|
||||
let element = (0, _)group;
|
||||
}
|
3
compiler/tests/group/x_sign_low.leo
Normal file
3
compiler/tests/group/x_sign_low.leo
Normal file
@ -0,0 +1,3 @@
|
||||
function main() {
|
||||
let element = (0, -)group;
|
||||
}
|
3
compiler/tests/group/y_sign_high.leo
Normal file
3
compiler/tests/group/y_sign_high.leo
Normal file
@ -0,0 +1,3 @@
|
||||
function main() {
|
||||
let element = (+, 1)group;
|
||||
}
|
3
compiler/tests/group/y_sign_inferred.leo
Normal file
3
compiler/tests/group/y_sign_inferred.leo
Normal file
@ -0,0 +1,3 @@
|
||||
function main() {
|
||||
let element = (_, 1)group;
|
||||
}
|
3
compiler/tests/group/y_sign_low.leo
Normal file
3
compiler/tests/group/y_sign_low.leo
Normal file
@ -0,0 +1,3 @@
|
||||
function main() {
|
||||
let element = (-, 1)group;
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
function main() {
|
||||
let a = 0group;
|
||||
}
|
Loading…
Reference in New Issue
Block a user