From e1d25b433b2a3011597f6e44f19fd1d526270abd Mon Sep 17 00:00:00 2001 From: Fletcher555 Date: Sat, 13 Dec 2025 07:25:45 -0500 Subject: [PATCH 1/3] Fix test_utils from running --- tests/{test_utils.rs => test_utils/mod.rs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/{test_utils.rs => test_utils/mod.rs} (100%) diff --git a/tests/test_utils.rs b/tests/test_utils/mod.rs similarity index 100% rename from tests/test_utils.rs rename to tests/test_utils/mod.rs From 7a1a45849dbe123eb245bf27cb46fdafc80a82fe Mon Sep 17 00:00:00 2001 From: Fletcher555 Date: Sat, 13 Dec 2025 07:36:42 -0500 Subject: [PATCH 2/3] Improve test suite to build to a single executable --- tests/{test_utils => common}/mod.rs | 0 tests/main_tests.rs | 6 ++++++ tests/{crud_test.rs => suites/basic_crud.rs} | 6 ++---- tests/{set_operators_test.rs => suites/set_operators.rs} | 8 +++----- tests/{transaction_test.rs => suites/transactions.rs} | 4 +--- 5 files changed, 12 insertions(+), 12 deletions(-) rename tests/{test_utils => common}/mod.rs (100%) create mode 100644 tests/main_tests.rs rename tests/{crud_test.rs => suites/basic_crud.rs} (99%) rename tests/{set_operators_test.rs => suites/set_operators.rs} (95%) rename tests/{transaction_test.rs => suites/transactions.rs} (99%) diff --git a/tests/test_utils/mod.rs b/tests/common/mod.rs similarity index 100% rename from tests/test_utils/mod.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..0b7e4e0 --- /dev/null +++ b/tests/main_tests.rs @@ -0,0 +1,6 @@ +mod common; +mod suites { + pub mod basic_crud; + pub mod transactions; + pub mod set_operators; +} \ No newline at end of file diff --git a/tests/crud_test.rs b/tests/suites/basic_crud.rs similarity index 99% rename from tests/crud_test.rs rename to tests/suites/basic_crud.rs index b97e2d5..7d7ce52 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,7 +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( + assert_eq_table_rows_unordered( expected_second, result.pop().unwrap().unwrap().unwrap(), ); diff --git a/tests/set_operators_test.rs b/tests/suites/set_operators.rs similarity index 95% rename from tests/set_operators_test.rs rename to tests/suites/set_operators.rs index b501de1..6ce7644 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,7 +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( + assert_eq_table_rows_unordered( expected_first, result.pop().unwrap().unwrap().unwrap(), ); 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() { From ea5d3066c635a9cb3535f56b6004e2f8d74be80d Mon Sep 17 00:00:00 2001 From: Fletcher555 Date: Sat, 13 Dec 2025 07:37:27 -0500 Subject: [PATCH 3/3] Fix fmt --- tests/main_tests.rs | 4 ++-- tests/suites/basic_crud.rs | 5 +---- tests/suites/set_operators.rs | 5 +---- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/tests/main_tests.rs b/tests/main_tests.rs index 0b7e4e0..13205e4 100644 --- a/tests/main_tests.rs +++ b/tests/main_tests.rs @@ -1,6 +1,6 @@ mod common; mod suites { pub mod basic_crud; - pub mod transactions; pub mod set_operators; -} \ No newline at end of file + pub mod transactions; +} diff --git a/tests/suites/basic_crud.rs b/tests/suites/basic_crud.rs index 7d7ce52..5462bb0 100644 --- a/tests/suites/basic_crud.rs +++ b/tests/suites/basic_crud.rs @@ -131,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)])]; - 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/suites/set_operators.rs b/tests/suites/set_operators.rs index 6ce7644..50e43c4 100644 --- a/tests/suites/set_operators.rs +++ b/tests/suites/set_operators.rs @@ -97,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())]), ]; - 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()