diff --git a/tests/test_utils.rs b/tests/common/mod.rs similarity index 100% rename from tests/test_utils.rs rename to tests/common/mod.rs diff --git a/tests/main_tests.rs b/tests/main_tests.rs new file mode 100644 index 0000000..13205e4 --- /dev/null +++ b/tests/main_tests.rs @@ -0,0 +1,6 @@ +mod common; +mod suites { + pub mod basic_crud; + pub mod set_operators; + pub mod transactions; +} diff --git a/tests/crud_test.rs b/tests/suites/basic_crud.rs similarity index 98% rename from tests/crud_test.rs rename to tests/suites/basic_crud.rs index b97e2d5..5462bb0 100644 --- a/tests/crud_test.rs +++ b/tests/suites/basic_crud.rs @@ -1,10 +1,8 @@ -mod test_utils; - use mollycache::db::database::Database; use mollycache::db::table::core::{row::Row, value::Value}; use mollycache::interpreter::run_sql; -use crate::test_utils::{assert_eq_run_sql, assert_eq_table_rows, assert_eq_table_rows_unordered}; +use crate::common::{assert_eq_run_sql, assert_eq_table_rows, assert_eq_table_rows_unordered}; #[test] fn test_select_with_order_by_and_offset() { @@ -133,10 +131,7 @@ fn test_complex_statements_crud() { Row(vec![Value::Text("John".to_string()), Value::Integer(25)]), ]; let expected_second = vec![Row(vec![Value::Integer(80)])]; - test_utils::assert_eq_table_rows_unordered( - expected_second, - result.pop().unwrap().unwrap().unwrap(), - ); + assert_eq_table_rows_unordered(expected_second, result.pop().unwrap().unwrap().unwrap()); assert!(result.pop().unwrap().unwrap().is_none()); assert_eq_table_rows_unordered(expected_first, result.pop().unwrap().unwrap().unwrap()); assert!( diff --git a/tests/set_operators_test.rs b/tests/suites/set_operators.rs similarity index 93% rename from tests/set_operators_test.rs rename to tests/suites/set_operators.rs index b501de1..50e43c4 100644 --- a/tests/set_operators_test.rs +++ b/tests/suites/set_operators.rs @@ -1,10 +1,8 @@ -mod test_utils; - use mollycache::db::database::Database; use mollycache::db::table::core::{row::Row, value::Value}; use mollycache::interpreter::run_sql; -use crate::test_utils::assert_eq_table_rows; +use crate::common::{assert_eq_table_rows, assert_eq_table_rows_unordered}; #[test] fn test_set_operators() { @@ -24,7 +22,7 @@ fn test_set_operators() { Row(vec![Value::Text("Jack".to_string())]), ]; let row = result.pop().unwrap().unwrap().unwrap(); - test_utils::assert_eq_table_rows_unordered(expected, row); + assert_eq_table_rows_unordered(expected, row); assert!( result .into_iter() @@ -99,10 +97,7 @@ fn test_set_operators_with_different_tables_and_clause() { Row(vec![Value::Text("Jim".to_string())]), Row(vec![Value::Text("Jack".to_string())]), ]; - test_utils::assert_eq_table_rows_unordered( - expected_first, - result.pop().unwrap().unwrap().unwrap(), - ); + assert_eq_table_rows_unordered(expected_first, result.pop().unwrap().unwrap().unwrap()); assert!( result .into_iter() diff --git a/tests/transaction_test.rs b/tests/suites/transactions.rs similarity index 99% rename from tests/transaction_test.rs rename to tests/suites/transactions.rs index 2d8f0c4..3520937 100644 --- a/tests/transaction_test.rs +++ b/tests/suites/transactions.rs @@ -1,10 +1,8 @@ -mod test_utils; - use mollycache::db::database::Database; use mollycache::db::table::core::{row::Row, value::Value}; use mollycache::interpreter::run_sql; -use crate::test_utils::assert_eq_run_sql_unordered; +use crate::common::assert_eq_run_sql_unordered; #[test] fn test_transaction() {