fix import tests

This commit is contained in:
collin 2020-07-30 13:01:04 -07:00
parent f03d0be080
commit 4566ac8e03
8 changed files with 24 additions and 22 deletions

View File

@ -1,5 +1,5 @@
import test_import.foo as bar;
function main() -> u32 {
return bar()
function main() {
assert_eq!(bar(), 1u32);
}

View File

@ -1,5 +1,5 @@
import test_import.foo;
function main() -> u32 {
return foo()
function main() {
assert_eq!(foo(), 1u32);
}

View File

@ -11,7 +11,7 @@ import bar.( // imports directory import
import car.Car; // imports directory import
function main() -> u32 {
function main() {
const point = Point { x: 1u32, y: 1u32 };
const foo = foo();
@ -21,5 +21,5 @@ function main() -> u32 {
const car = Car { c: 1u32 };
return car.c
assert_eq!(car.c, 1u32);
}

View File

@ -5,7 +5,7 @@ import bar.baz.*; // imports directory import
import bar.bat.bat.*; // imports directory import
import car.*; // imports directory import
function main() -> u32 {
function main() {
const point = Point { x: 1u32, y: 1u32 };
const foo = foo();
@ -15,5 +15,5 @@ function main() -> u32 {
const car = Car { c: 1u32 };
return car.c
assert_eq!(car.c, 1u32);
}

View File

@ -1,4 +1,4 @@
use crate::{integers::u32::output_one, parse_program};
use crate::{assert_satisfied, parse_program};
use std::env::{current_dir, set_current_dir};
@ -21,7 +21,7 @@ fn test_basic() {
let bytes = include_bytes!("basic.leo");
let program = parse_program(bytes).unwrap();
output_one(program);
assert_satisfied(program);
}
#[test]
@ -32,7 +32,7 @@ fn test_multiple() {
let bytes = include_bytes!("multiple.leo");
let program = parse_program(bytes).unwrap();
output_one(program);
assert_satisfied(program);
}
#[test]
@ -43,7 +43,7 @@ fn test_star() {
let bytes = include_bytes!("star.leo");
let program = parse_program(bytes).unwrap();
output_one(program);
assert_satisfied(program);
}
#[test]
@ -63,7 +63,7 @@ fn test_alias() {
let bytes = include_bytes!("alias.leo");
let program = parse_program(bytes).unwrap();
output_one(program);
assert_satisfied(program);
}
// more complex tests
@ -75,7 +75,7 @@ fn test_many_import() {
let bytes = include_bytes!("many_import.leo");
let program = parse_program(bytes).unwrap();
output_one(program);
assert_satisfied(program);
}
#[test]
@ -86,5 +86,5 @@ fn test_many_import_star() {
let bytes = include_bytes!("many_import_star.leo");
let program = parse_program(bytes).unwrap();
output_one(program);
assert_satisfied(program);
}

View File

@ -3,7 +3,8 @@ import test_import.(
foo
);
function main() -> u32 {
let p = Point { x: 1u32, y: 0u32 };
return p.x
function main() {
let a = Point { x: 1u32, y: 0u32 };
assert_eq!(a.x, 1u32);
}

View File

@ -1,6 +1,7 @@
import test_import.*;
function main() -> u32 {
let p = Point { x: 1u32, y: 0u32 };
return foo()
function main() {
let a = Point { x: 1u32, y: 0u32 };
assert_eq!(foo(), 1u32);
}

View File

@ -5,7 +5,7 @@ pub mod circuits;
pub mod field;
pub mod function;
pub mod group;
// pub mod import;
pub mod import;
// pub mod inputs;
// pub mod integers;
// pub mod macros;