Fix tests

This commit is contained in:
howardwu 2020-06-07 21:26:49 -07:00
parent 6ad5dc75d5
commit 81407ac182
104 changed files with 45 additions and 34 deletions

View File

@ -1,8 +1,9 @@
use crate::{compile_program, get_error, get_output, EdwardsConstrainedValue, EdwardsTestCompiler};
use leo_compiler::{
errors::{CompilerError, FunctionError, IntegerError},
ConstrainedValue, InputValue, Integer,
errors::{CompilerError, FunctionError},
ConstrainedValue,
};
use leo_types::{InputValue, Integer, IntegerError};
use snarkos_models::gadgets::utilities::uint::UInt32;

View File

@ -1,8 +1,9 @@
use crate::{compile_program, get_error, get_output, EdwardsConstrainedValue, EdwardsTestCompiler};
use leo_compiler::{
errors::{BooleanError, CompilerError, ExpressionError, FunctionError, StatementError},
ConstrainedValue, InputValue,
ConstrainedValue,
};
use leo_types::InputValue;
use snarkos_models::gadgets::utilities::boolean::Boolean;

View File

@ -1,16 +1,17 @@
use crate::{
compile_program, get_error, get_output, integer::u32::output_one, EdwardsConstrainedValue,
compile_program, get_error, get_output, integers::u32::output_one, EdwardsConstrainedValue,
EdwardsTestCompiler,
};
use leo_compiler::{
errors::{CompilerError, ExpressionError, FunctionError, StatementError},
ConstrainedCircuitMember, ConstrainedValue, Expression, Function, Identifier, Integer,
Statement, Type,
ConstrainedCircuitMember, ConstrainedValue,
};
use leo_types::{Expression, Function, Identifier, Integer,
Statement, Type,};
use snarkos_models::gadgets::utilities::uint::UInt32;
const DIRECTORY_NAME: &str = "tests/circuit/";
const DIRECTORY_NAME: &str = "tests/circuits/";
// Circ { x: 1u32 }
fn output_circuit(program: EdwardsTestCompiler) {

View File

@ -2,8 +2,9 @@ use crate::boolean::{output_expected_boolean, output_false, output_true};
use crate::{compile_program, get_error, get_output, EdwardsConstrainedValue, EdwardsTestCompiler};
use leo_compiler::{
errors::{CompilerError, FieldError, FunctionError},
ConstrainedValue, FieldType, InputValue,
ConstrainedValue, FieldType,
};
use leo_types::InputValue;
use snarkos_curves::edwards_bls12::Fq;
use snarkos_gadgets::curves::edwards_bls12::FqGadget;

View File

@ -1,5 +1,5 @@
use crate::{
compile_program, get_error, get_output, integer::u32::output_one, EdwardsConstrainedValue,
compile_program, get_error, get_output, integers::u32::output_one, EdwardsConstrainedValue,
EdwardsTestCompiler,
};
use leo_compiler::{

View File

@ -2,7 +2,8 @@ use crate::{
boolean::{output_false, output_true},
compile_program, fail_enforce, get_output, EdwardsConstrainedValue, EdwardsTestCompiler,
};
use leo_compiler::{group::edwards_bls12::EdwardsGroupType, ConstrainedValue, InputValue};
use leo_compiler::{group::edwards_bls12::EdwardsGroupType, ConstrainedValue};
use leo_types::InputValue;
use snarkos_curves::edwards_bls12::{EdwardsAffine, Fq};
use snarkos_gadgets::curves::edwards_bls12::EdwardsBlsGadget;

View File

@ -1,4 +1,4 @@
use crate::{compile_program, integer::u32::output_one};
use crate::{compile_program, integers::u32::output_one};
const DIRECTORY_NAME: &str = "tests/import/";

View File

@ -2,7 +2,8 @@
pub mod macros;
use crate::{get_error, EdwardsTestCompiler};
use leo_compiler::errors::{CompilerError, FunctionError, IntegerError};
use leo_compiler::errors::{CompilerError, FunctionError};
use leo_types::IntegerError;
pub trait IntegerTester {
/// Tests use of the integer in a function input

View File

@ -1,16 +1,17 @@
use crate::{
boolean::{output_expected_boolean, output_false, output_true},
compile_program, get_output,
integer::{fail_integer, fail_synthesis, IntegerTester},
integers::{fail_integer, fail_synthesis, IntegerTester},
EdwardsConstrainedValue, EdwardsTestCompiler,
};
use leo_compiler::{types::Integer, ConstrainedValue, InputValue};
use leo_compiler::ConstrainedValue;
use leo_types::{Integer, InputValue};
use snarkos_curves::edwards_bls12::Fq;
use snarkos_models::gadgets::r1cs::TestConstraintSystem;
use snarkos_models::gadgets::utilities::{alloc::AllocGadget, uint::UInt128};
const DIRECTORY_NAME: &str = "tests/integer/u128/";
const DIRECTORY_NAME: &str = "tests/integers/u128/";
fn output_expected_allocated(program: EdwardsTestCompiler, expected: UInt128) {
let output = get_output(program);

View File

@ -1,16 +1,17 @@
use crate::{
boolean::{output_expected_boolean, output_false, output_true},
compile_program, get_output,
integer::{fail_integer, fail_synthesis, IntegerTester},
integers::{fail_integer, fail_synthesis, IntegerTester},
EdwardsConstrainedValue, EdwardsTestCompiler,
};
use leo_compiler::{types::Integer, ConstrainedValue, InputValue};
use leo_compiler::ConstrainedValue;
use leo_types::{Integer, InputValue};
use snarkos_curves::edwards_bls12::Fq;
use snarkos_models::gadgets::r1cs::TestConstraintSystem;
use snarkos_models::gadgets::utilities::{alloc::AllocGadget, uint::UInt16};
const DIRECTORY_NAME: &str = "tests/integer/u16/";
const DIRECTORY_NAME: &str = "tests/integers/u16/";
fn output_expected_allocated(program: EdwardsTestCompiler, expected: UInt16) {
let output = get_output(program);

View File

@ -1,16 +1,17 @@
use crate::{
boolean::{output_expected_boolean, output_false, output_true},
compile_program, get_output,
integer::{fail_integer, fail_synthesis, IntegerTester},
integers::{fail_integer, fail_synthesis, IntegerTester},
EdwardsConstrainedValue, EdwardsTestCompiler,
};
use leo_compiler::{types::Integer, ConstrainedValue, InputValue};
use leo_compiler::ConstrainedValue;
use leo_types::{Integer, InputValue};
use snarkos_curves::edwards_bls12::Fq;
use snarkos_models::gadgets::r1cs::TestConstraintSystem;
use snarkos_models::gadgets::utilities::{alloc::AllocGadget, uint::UInt32};
const DIRECTORY_NAME: &str = "tests/integer/u32/";
const DIRECTORY_NAME: &str = "tests/integers/u32/";
fn output_expected_allocated(program: EdwardsTestCompiler, expected: UInt32) {
let output = get_output(program);

View File

@ -1,16 +1,17 @@
use crate::{
boolean::{output_expected_boolean, output_false, output_true},
compile_program, get_output,
integer::{fail_integer, fail_synthesis, IntegerTester},
integers::{fail_integer, fail_synthesis, IntegerTester},
EdwardsConstrainedValue, EdwardsTestCompiler,
};
use leo_compiler::{types::Integer, ConstrainedValue, InputValue};
use leo_compiler::ConstrainedValue;
use leo_types::{Integer, InputValue};
use snarkos_curves::edwards_bls12::Fq;
use snarkos_models::gadgets::r1cs::TestConstraintSystem;
use snarkos_models::gadgets::utilities::{alloc::AllocGadget, uint::UInt64};
const DIRECTORY_NAME: &str = "tests/integer/u64/";
const DIRECTORY_NAME: &str = "tests/integers/u64/";
fn output_expected_allocated(program: EdwardsTestCompiler, expected: UInt64) {
let output = get_output(program);

View File

@ -1,16 +1,17 @@
use crate::{
boolean::{output_expected_boolean, output_false, output_true},
compile_program, get_output,
integer::{fail_integer, fail_synthesis, IntegerTester},
integers::{fail_integer, fail_synthesis, IntegerTester},
EdwardsConstrainedValue, EdwardsTestCompiler,
};
use leo_compiler::{types::Integer, ConstrainedValue, InputValue};
use leo_compiler::ConstrainedValue;
use leo_types::{Integer, InputValue};
use snarkos_curves::edwards_bls12::Fq;
use snarkos_models::gadgets::r1cs::TestConstraintSystem;
use snarkos_models::gadgets::utilities::{alloc::AllocGadget, uint::UInt8};
const DIRECTORY_NAME: &str = "tests/integer/u8/";
const DIRECTORY_NAME: &str = "tests/integers/u8/";
fn output_expected_allocated(program: EdwardsTestCompiler, expected: UInt8) {
let output = get_output(program);

View File

@ -5,7 +5,7 @@ pub mod field;
pub mod function;
pub mod group;
pub mod import;
pub mod integer;
pub mod integers;
pub mod mutability;
pub mod statements;
pub mod syntax;

Some files were not shown because too many files have changed in this diff Show More