Skip to content

TOOLS-4278 Convert mongoimport csv tests to testify - #1063

Draft
autarch wants to merge 1 commit into
TOOLS-4278-convey-to-testify-mongoimport-tsv-jsonfrom
TOOLS-4278-convey-to-testify-mongoimport-csv
Draft

TOOLS-4278 Convert mongoimport csv tests to testify#1063
autarch wants to merge 1 commit into
TOOLS-4278-convey-to-testify-mongoimport-tsv-jsonfrom
TOOLS-4278-convey-to-testify-mongoimport-csv

Conversation

@autarch

@autarch autarch commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Applies the migration conventions to mongoimport/csv_test.go:

  • Flattens the pure-wrapper top-level Convey in each Test* function and
    collapses same-shape nested Conveys into table-driven cases.
  • Collapses the UTF-8 BOM case's per-field comparison loop into a
    whole-document compare. The old loop ranged over the actual document
    and indexed into the expectation, so it never checked field count and
    would panic rather than fail on an extra field. 14 per-field checks
    become 4 strictly stronger ones.
  • Keeps the nested-field case field-by-field, because the reader decodes
    that value as *bson.D while the expectation is bson.D. Collapsing it
    would have meant rewriting the expectation and dropping its type
    assertion.

No behavior change.

Applies the migration conventions to mongoimport/csv_test.go:

- Flattens the pure-wrapper top-level Convey in each Test* function and
  collapses same-shape nested Conveys into table-driven cases.
- Collapses the UTF-8 BOM case's per-field comparison loop into a
  whole-document compare. The old loop ranged over the actual document
  and indexed into the expectation, so it never checked field count and
  would panic rather than fail on an extra field. 14 per-field checks
  become 4 strictly stronger ones.
- Keeps the nested-field case field-by-field, because the reader decodes
  that value as *bson.D while the expectation is bson.D. Collapsing it
  would have meant rewriting the expectation and dropping its type
  assertion.

No behavior change.

autarch commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant