Use default rust directory structure for tests

This commit is contained in:
Juan Ibiapina 2018-06-13 10:56:29 +02:00
parent 59c60c43d1
commit e534e907e8
28 changed files with 89 additions and 66 deletions

View File

@ -47,9 +47,6 @@ mod engine;
mod fn_register;
mod parser;
#[cfg(test)]
mod tests;
pub use any::Any;
pub use engine::{Engine, EvalAltResult, Scope};
pub use fn_register::RegisterFn;

View File

@ -1,26 +0,0 @@
mod arrays;
mod binary_ops;
mod bit_shift;
mod bool_op;
mod chars;
mod comments;
mod compound_equality;
mod decrement;
mod float;
mod get_set;
mod if_block;
mod increment;
mod internal_fn;
mod looping;
mod method_call;
mod mismatched_op;
mod not;
mod number_literals;
mod ops;
mod power_of;
mod string;
mod unary_after_binary;
mod unary_minus;
mod unit;
mod var_scope;
mod while_loop;

View File

@ -1,5 +1,7 @@
use engine::Engine;
use fn_register::RegisterFn;
extern crate rhai;
use rhai::Engine;
use rhai::RegisterFn;
#[test]
fn test_arrays() {
@ -63,4 +65,4 @@ fn test_array_with_structs() {
} else {
assert!(false);
}
}
}

View File

@ -1,4 +1,6 @@
use engine::Engine;
extern crate rhai;
use rhai::Engine;
#[test]
fn test_binary_ops() {

View File

@ -1,4 +1,6 @@
use engine::Engine;
extern crate rhai;
use rhai::Engine;
#[test]
fn test_left_shift() {

View File

@ -1,4 +1,6 @@
use engine::Engine;
extern crate rhai;
use rhai::Engine;
#[test]
fn test_bool_op1() {
@ -20,4 +22,4 @@ fn test_bool_op2() {
} else {
assert!(false);
}
}
}

View File

@ -1,4 +1,6 @@
use engine::Engine;
extern crate rhai;
use rhai::Engine;
#[test]
fn test_chars() {
@ -20,4 +22,4 @@ fn test_chars() {
Err(_) => (),
_ => assert!(false),
}
}
}

View File

@ -1,4 +1,6 @@
use engine::Engine;
extern crate rhai;
use rhai::Engine;
#[test]
fn test_comments() {

View File

@ -1,4 +1,6 @@
use engine::Engine;
extern crate rhai;
use rhai::Engine;
#[test]
fn test_or_equals() {
@ -116,4 +118,4 @@ fn test_modulo_equals() {
} else {
assert!(false);
}
}
}

View File

@ -1,4 +1,6 @@
use engine::Engine;
extern crate rhai;
use rhai::Engine;
#[test]
fn test_decrement() {

View File

@ -1,5 +1,7 @@
use engine::Engine;
use fn_register::RegisterFn;
extern crate rhai;
use rhai::Engine;
use rhai::RegisterFn;
#[test]
fn test_float() {

View File

@ -1,5 +1,7 @@
use engine::Engine;
use fn_register::RegisterFn;
extern crate rhai;
use rhai::Engine;
use rhai::RegisterFn;
#[test]
fn test_get_set() {

View File

@ -1,4 +1,6 @@
use engine::Engine;
extern crate rhai;
use rhai::Engine;
#[test]
fn test_if() {

View File

@ -1,4 +1,6 @@
use engine::Engine;
extern crate rhai;
use rhai::Engine;
#[test]
fn test_increment() {

View File

@ -1,4 +1,6 @@
use engine::Engine;
extern crate rhai;
use rhai::Engine;
#[test]
fn test_internal_fn() {

View File

@ -1,4 +1,6 @@
use engine::Engine;
extern crate rhai;
use rhai::Engine;
#[test]
fn test_loop() {

View File

@ -1,5 +1,7 @@
use engine::Engine;
use fn_register::RegisterFn;
extern crate rhai;
use rhai::Engine;
use rhai::RegisterFn;
#[test]
fn test_method_call() {

View File

@ -1,4 +1,6 @@
use engine::{Engine, EvalAltResult};
extern crate rhai;
use rhai::{Engine, EvalAltResult};
#[test]
fn test_mismatched_op() {

View File

@ -1,4 +1,6 @@
use engine::Engine;
extern crate rhai;
use rhai::Engine;
#[test]
fn test_not() {

View File

@ -1,4 +1,6 @@
use engine::Engine;
extern crate rhai;
use rhai::Engine;
#[test]
fn test_number_literal() {
@ -60,4 +62,4 @@ fn test_binary_literal() {
} else {
assert!(false);
}
}
}

View File

@ -1,4 +1,6 @@
use engine::Engine;
extern crate rhai;
use rhai::Engine;
#[test]
fn test_ops() {
@ -26,4 +28,4 @@ fn test_op_prec() {
} else {
assert!(false);
}
}
}

View File

@ -1,4 +1,6 @@
use engine::Engine;
extern crate rhai;
use rhai::Engine;
#[test]
fn test_power_of() {

View File

@ -1,4 +1,6 @@
use engine::Engine;
extern crate rhai;
use rhai::Engine;
#[test]
fn test_string() {

View File

@ -1,4 +1,6 @@
use engine::Engine;
extern crate rhai;
use rhai::Engine;
#[test]
// TODO also add test case for unary after compound

View File

@ -1,4 +1,6 @@
use engine::Engine;
extern crate rhai;
use rhai::Engine;
#[test]
fn test_unary_minus() {

View File

@ -1,4 +1,6 @@
use engine::Engine;
extern crate rhai;
use rhai::Engine;
#[test]
fn test_unit() {
@ -31,4 +33,4 @@ fn test_unit_with_spaces() {
} else {
assert!(false);
}
}
}

View File

@ -1,4 +1,6 @@
use engine::{Engine, Scope};
extern crate rhai;
use rhai::{Engine, Scope};
#[test]
fn test_var_scope() {

View File

@ -1,4 +1,6 @@
use engine::Engine;
extern crate rhai;
use rhai::Engine;
#[test]
fn test_while() {