Skip to content

test(errors): assert typed refusal variants, not Display - #114

Open
mfw78 wants to merge 2 commits into
types/t5-from-wiringfrom
types/t6-typed-asserts
Open

test(errors): assert typed refusal variants, not Display#114
mfw78 wants to merge 2 commits into
types/t5-from-wiringfrom
types/t6-typed-asserts

Conversation

@mfw78

@mfw78 mfw78 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

What

Replaces Display-substring assertions on typed refusals with a Refusal variant matcher across nexum-runtime and nexum-sdk test suites, and strengthens the value-carrying cases to assert the underlying field rather than just the variant.

Why

Closes #52

Matching on err.to_string().contains("...") couples tests to user-facing wording (the house style is Oxford British, so copy churns) and lets a wrong variant that happens to share a substring pass. Matching the typed variant, and destructuring the field where a value matters, ties the assertion to behaviour instead of prose.

Testing

cargo nextest run -p nexum-runtime -p nexum-sdk -p nexum-module-macros

AI Assistance

Implementation: Claude (Fable 5). Red-team: Claude (Opus 5). PR: Claude (Sonnet 5).

mfw78 added 2 commits August 6, 2026 15:38
AI Assistance: Claude (Fable 5) used for the Refusal variant matcher and the assertion migration.
AI Assistance: Claude (Opus 5) used for the red-team pass and the assertion strengthening.
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