Repository navigation
test: simplify parser tests (#380 part 5) - #392
Merged
Merged
Conversation
Add table/index/create/create_spec/validate_file helpers, TestResult and
TempDir::{target,is_empty,entries} to the parser testkit and migrate the
per-file TestResult aliases, directory wrappers and plain schema literals
to them. No test behavior changes.
Fold the fixed-field, indexed-update, text/GUID insert, delete compaction and release, and empty-OLE files into their family files; share one table-driven exact-budget/verification test across the delete shapes; drop tests that re-assert the shared publish layer through each operation; collapse repeated insert/delete boilerplate into fixture helpers.
… long-value files
Merge files that exercise the same decoder (table pages/alias into the table-definition tests, catalog overflow into the cursor tests, index key inventory/prefix into the tree reader tests, binary row trailers into the wide-row tests), table-drive repeated corruption cases, share row-cursor and read helpers, and drop Display/source-only error tests plus the catalog record-writer tests that only exercised a test-local encoder.
…tests Table-drive parallel boundary and limit cases, drop Display/source-chain checks and duplicated candidate/header-page failure paths, and remove integration tests that repeat unit-tested atomic publication and header composition paths.
This was referenced Sep 24, 2026
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.
Part 5 of #380: simplify the
jet3parser crate's tests. Only test code changed:*_tests.rs,tests.rs,testkit.rs,crates/jet3/tests/**, and the#[cfg(test)] modlines for deleted files. Production code is unchanged.Numbers
origin/main)cargo test -p jet3)src/)src/)tests/)src/, tests excluded)Coverage was measured with
cargo llvm-cov -p jet3, excluding_tests.rs,tests.rs,testkit.rsandtests/. A diff-aligned per-line comparison found 0 prod lines that ran at baseline and no longer run. That includes every error, refusal and budget branch. Two branches lost coverage mid-cleanup, and each got a focused case back:row/data_page.rswrite_freecomposer/table_create.rsrow/delete_page.rsgained one covered line. Region coverage fell by 7 regions (-0.007 pp), but no line lost coverage.What changed
Shared builders (
testkit). Added:TestResulttable(name, columns, indexes)andindex(name, fields, kind)create(path, tables)andcreate_spec(path, spec)validate_file(path)TempDir::{target, is_empty, entries}These replace 37 per-file
TestResultaliases and 5 per-file temp-directory wrappers. About 250TableSpec {..}/IndexSpec {..}literals and about 230create_database(.., &mut budget())calls were migrated to the new builders.Relationships (18 → 16 files):
larger_relationship_graphmerged intoapi_relationship_graph.relationship_parameterizedmerged intorelationship_tests, with its refusal cases table-driven and the exactdetailstrings kept.Row mutation:
update_fixedandupdate_indexedfolded intoupdate_field_rewriteandupdate_key.delete_compactionanddelete_releasefolded intodelete_tests, with one budget table over tail, compaction and release that keeps the exact and one-below limits.insert_text_guidmoved intoinsert_scalar_index.mutation_emptymoved intomutation_field.index_matrixcovers it.write/driver.rspublish. The full stage loop stays inupdate_testsandwrite/atomic_tests.Creation:
memo_optionintoempty_value_optionsinitial_long_valuesintomultiple_long_valuesindex_capacityintomultiple_indexcomposite_indexandmulti_level_indexintoinitial_indexschema_planrefusals and the append/whole-file plan rejections are now table-driven.Storage decoders:
table_pages/table_index_alias,catalog/overflow,reader_key_inventory/reader_prefix,writer_binary.catalog/record_writer_testswas deleted. It tested an encoder defined inside the test file. Its one prod check, thecatalog_record_lenlimits, moved torecord_tests.Display/source()text ofthiserrorerrors.Format, validation and integration:
database_testswent from 24 tests to 9 table-driven tests.tests/header_composition_properties.rswas deleted. It is uncited and repeated candidate and commit-region accounting that the unit tests already assert.tests/atomic_publication.rsdropped its per-stage fault loop, whichwrite/atomic_testscovers through the same hook. It keeps the concurrent-observer test.defaults_match_documented_policy, which asserted constants against themselves.Deliberately kept
docs/validation/support-matrix.json, along with the tests demonstrating its capability. No doc or matrix path references a deleted file or test.Checks
just readypasses: fmt, clippy-D warnings, workspace tests, docs, source size (≤800 lines per file) and contracts.cargo check --target x86_64-pc-windows-gnu -p jet3 --all-targetsis clean.🤖 Generated with Claude Code