Tests
Running Tests
# All tests
cargo test
# With output display
cargo test -- --nocapture
# Specific test
cargo test test_name
# Integration tests only
cargo test --test integration
Test Structure
The project has 20 integration test files in tests/, plus inline unit tests in several src/ modules.
Unit Tests (inline #[cfg(test)] mod tests in src/)
json.rs,json_arrow.rs,json_leaf_infer.rs,json_normalize.rs— JSON parsing, nested-type inference, flatteningxlsx.rs,to_xlsx.rs— spreadsheet reading and XLSX writingmemory.rs—/proc/meminfoparsing, adaptive block/thread sizing (Linux only)diag.rs— phase-timing/RSS instrumentationconversion/json_pipeline.rs— parallel nested-JSON block engine
Integration Tests (tests/)
schema_tests.rs,schema_threshold_tests.rs,schema_override_tests.rs— type inference, timestamp confidence threshold, forced column typesconversions_tests.rs— value → Arrow conversiondelimiter_tests.rs— delimiter auto-detectionanalysis_tests.rs,error_analysis_tests.rs— block analysis, error countersheuristic_robustness_tests.rs,noise_robustness_tests.rs— header/type heuristics under noisy datastrict_order_tests.rs— strict block ordering under parallel conversionintegration_pipeline_tests.rs— end-to-end CSV → Parquet pipelinenormalized_tests.rs— large scenario suite (also covers.gz/.zstauto-decompression)utils_tests.rs— utilities (delimiter/header/date helpers)xlsx_e2e.rs— Excel → Parquet round-tripexport_formats_tests.rs— JSON-array and multi-sheet-XLSX round-trips (forward and reverse)inverse_and_inspect_tests.rs— Parquet → CSV/JSONL and schema/stats inspectionparquet_to_csv_robust_tests.rs— Parquet → CSV robustnessnested_json_tests.rs— native nested-JSON Arrow path and--flatten(separator, max-level, mixed depth)parquet_rewrite_tests.rs— Parquet column renaming (GUI’s column-rename feature)preview_tests.rs— headless data preview (--preview, viewer)
Fixture Generation
The src/data_generator.rs binary generates test data in CSV, TSV, JSON, and JSONL formats:
cargo run --bin data_generator
Produces datasets in datasets_tests/ with various noise strategies, typed columns, and edge-case scenarios.
Python Test
A Python script allows validating Parquet output:
python3 test_convert_to_parquet.py
Requirements: pyarrow (pip install pyarrow).
Makefile
make test # cargo test
make check # cargo check (quick verification)
make lint # cargo clippy -- -D warnings
make fmt # cargo fmt