1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
//! TegDB Test Suite Organization
//!
//! This test suite is organized into the following categories:
//!
//! ## Unit Tests (`unit/`)
//! Tests for individual components and modules:
//! - `catalog_tests.rs` - Schema catalog management
//! - `planner_tests.rs` - Query planning and optimization
//! - `storage_format_tests.rs` - Data serialization/deserialization
//! - `protocol_utils_tests.rs` - Storage protocol parsing
//! - `lib_tests.rs` - Library-level functionality
//!
//! ## Integration Tests (`integration/`)
//! Tests for component interactions and end-to-end functionality:
//! - `database_tests.rs` - High-level database API
//! - `engine_tests.rs` - Storage engine operations
//! - `transaction_tests.rs` - Transaction management
//! - `sql_integration_tests.rs` - SQL parsing and execution
//! - `sql_parser_tests.rs` - SQL parser functionality
//! - `transaction_parsing_tests.rs` - Transaction statement parsing
//! - `explicit_transaction_integration_tests.rs` - Explicit transaction handling
//! - `planner_database_integration_test.rs` - Planner-database integration
//! - `query_processor_validation_test.rs` - Query execution validation
//! - `query_processor_acid_tests_new.rs` - ACID compliance testing
//! - `query_iterator_test.rs` - Query result iteration
//! - `read_only_transaction_test.rs` - Read-only transaction optimization
//! - `schema_persistence_test.rs` - Schema persistence across sessions
//! - `simplified_api_test.rs` - Simplified API functionality
//! - `backend_compatibility_test.rs` - Multi-backend compatibility
//! - `commit_marker_tests.rs` - Commit marker functionality
//! - `drop_table_integration_test.rs` - Table dropping integration
//! - `vector_search_tests.rs` - Vector search and similarity functionality
//!
//! ## Performance Tests (`performance/`)
//! Tests focused on performance and scalability:
//! - `high_level_api_performance_test.rs` - High-level API performance
//!
//! ## Arithmetic Tests (`arithmetic/`)
//! Tests for arithmetic expression handling:
//! - `arithmetic_expressions_test.rs` - Basic arithmetic operations
//! - `arithmetic_edge_cases_test.rs` - Edge cases in arithmetic
//! - `arithmetic_parser_tests.rs` - Arithmetic expression parsing
//!
//! ## Test Helpers (`helpers/`)
//! Shared utilities and documentation:
//! - `test_helpers.rs` - Common test utilities
//! - `README.md` - Test helper documentation
//! - `convert_test_example.sh` - Test conversion examples
//!
//! ## Running Tests
//!
//! ### Run all tests:
//! ```bash
//! cargo test --features dev
//! ```
//!
//! ### Run specific test categories:
//! ```bash
//! # Unit tests only
//! cargo test --features dev unit
//!
//! # Integration tests only
//! cargo test --features dev integration
//!
//! # Performance tests only
//! cargo test --features dev performance
//!
//! # Arithmetic tests only
//! cargo test --features dev arithmetic
//! ```
//!
//! ### Run specific test files:
//! ```bash
//! cargo test --features dev --test database_tests
//! cargo test --features dev --test engine_tests
//! ```
//!
//! ## Test Organization Principles
//!
//! 1. **Unit Tests**: Test individual components in isolation
//! 2. **Integration Tests**: Test component interactions and end-to-end workflows
//! 3. **Performance Tests**: Measure and validate performance characteristics
//! 4. **Arithmetic Tests**: Validate mathematical expression handling
//! 5. **Vector Tests**: Validate vector search and similarity functionality
//! 6. **Test Helpers**: Provide reusable utilities and documentation
//!
//! ## Adding New Tests
//!
//! When adding new tests, follow these guidelines:
//!
//! 1. **Unit Tests**: Place in `unit/` for testing individual functions or small components
//! 2. **Integration Tests**: Place in `integration/` for testing component interactions
//! 3. **Performance Tests**: Place in `performance/` for benchmarking and performance validation
//! 4. **Arithmetic Tests**: Place in `arithmetic/` for mathematical expression handling
//! 5. **Vector Tests**: Place in `integration/` for vector search and similarity functionality
//!
//! ## Test Naming Conventions
//!
//! - Use descriptive test names that explain what is being tested
//! - Group related tests in the same file
//! - Use consistent naming patterns within each category
//! - Include both positive and negative test cases
//!
//! ## Test Dependencies
//!
//! Most tests require the `dev` feature to access internal APIs:
//! ```rust
//! #[cfg(feature = "dev")]
//! ```
//!
//! Use the test helpers for consistent file-backed testing.
// Re-export test modules for easy access