Skip to content

Isolate and strengthen field-sorting tests #577

Description

@claell

Problem

The field-sorting middleware tests reuse one module-level mutable Entry. Because in-place middleware cases reorder that shared object, later tests can inherit earlier mutations and assert an order that depends on test execution history rather than the documented behavior.

The suite also leaves several useful contracts implicit:

  • fields omitted from a custom order retain their original relative order;
  • custom ordering works through the public writer without mutating the source library when in-place modification is disabled; and
  • ambiguous custom orders with duplicate keys, including case-only duplicates under case-insensitive matching, fail early.

Proposed coverage

Construct a fresh entry for each test, correct the stable-order assertion, and add focused public-writer and duplicate-order cases. This should be a test-only change because current production behavior already satisfies the contracts.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions