Skip to content

test(core): cover EntityKey equality, hashing, ordering, and string representation #19

Description

@philipgreat

Background

EntityKey is used as the key for TreeMap and TreeSet collections in the change-tracking ledger, but teaql-core currently has no unit tests.

Scope

Add a focused EntityKeyTest.

Test cases

  • Keys with the same entity type and ID are equal and have the same hash code.
  • Different entity types or IDs are not equal.
  • Natural ordering sorts first by entity type and then by ID.
  • A null ID sorts consistently before non-null IDs of the same type.
  • A null entity type is rejected.
  • toString() renders the stable type:id form.

Acceptance criteria

  • Tests run in the teaql-core module with JUnit 4.
  • Tests cover only EntityKey; no production behavior is changed unless a failing contract test reveals a defect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestjavaPull requests that update java code

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions