feat: add cross-format integration tests and CLI end-to-end tests#42
Merged
feat: add cross-format integration tests and CLI end-to-end tests#42
Conversation
- Add tests/cross_format.rs with 45 integration tests covering:
- All format pair roundtrips: JSON↔YAML, JSON↔TOML, JSON↔CSV,
YAML↔TOML, YAML↔CSV, TOML↔CSV
- Three-format chains: JSON→YAML→TOML→JSON, YAML→TOML→JSON→YAML,
JSON→CSV→YAML→JSON, CSV→JSON→TOML→CSV
- Format-specific limitations: TOML top-level array rejection,
TOML null→string conversion, CSV nested object flattening,
CSV type inference, TOML datetime→string
- Unicode cross-format roundtrips
- Large dataset (500 rows) cross-format roundtrips
- 11 CLI end-to-end tests: json→yaml, yaml→json, json→toml,
csv→json, json→csv, --formats flag, file output, stdin→stdout,
unknown format error, --pretty flag, --compact flag
- Fix CSV float serialization to preserve decimal point (87.0 not 87)
Fixes #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #14 — Integration tests.
Changes
New test file:
tests/cross_format.rs(45 integration tests)Cross-format roundtrip tests (all pairs):
Three-format chain tests (A→B→C→A):
Format limitation edge cases:
CLI end-to-end tests (11):
--formatsflag, file output (-o), stdin→stdout--prettyflag,--compactflagBug fix:
csv_field_to_stringfor Float now ensures decimal point is preserved (e.g.,87.0instead of87), so roundtripping floats through CSV maintains the Float type via type inference.All checks pass:
cargo build,cargo test(291 tests),cargo fmt --check,cargo clippy -D warnings.