Skip to content

Add explicit tests for Rejection Pass-Through and Value Extraction Consistency#4

Draft
Copilot wants to merge 2 commits intoprincipalfrom
copilot/verify-mathematical-properties
Draft

Add explicit tests for Rejection Pass-Through and Value Extraction Consistency#4
Copilot wants to merge 2 commits intoprincipalfrom
copilot/verify-mathematical-properties

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 5, 2026

Addresses the two TODO items in the Property Verification Strategy: CLAIM 6 (Rejection Pass-Through) had no isolated test proving SettledLeft items skip transformation, and CLAIM 7 (Value Extraction Consistency) lacked explicit tests defining the semantic contract between getValues(), getAllValues(), and toArray().

Rejection Pass-Through (rejectionPassThrough.test.ts — 5 tests)

  • Asserts transformFn is never called on already-rejected items
  • Validates currentRejection: false for inherited errors vs true for errors thrown in current step
  • Verifies index, transformStep, and errLookup callback args are preserved correctly on pass-through
const transformFn = jest.fn(async (x: string) => x.toUpperCase());
const result = await fn_a1f9a({
  item: { status: 'rejected', reason: new Error('previous error') },
  index: 0, array: [rejectedItem], transform: transformFn,
});
expect(transformFn).not.toHaveBeenCalled();
expect(result).toHaveProperty('currentRejection', false);

Value Extraction Consistency (valueExtraction.test.ts — 13 tests)

  • getValues() — returns only fulfilled values; empty array when all rejected
  • getAllValues() — preserves array length; NULL_SYMBOL at rejected positions
  • toArray() — full settled metadata (status, index, transformStep)
  • Cross-method invariants:
    • getValues().length <= getAllValues().length
    • toArray().length === getAllValues().length
    • NULL_SYMBOL positions in getAllValues() align with status: 'rejected' in toArray()
    • getValues() matches the fulfilled subset of toArray()

Baseline 253 → 271 tests, all passing.

Copilot AI and others added 2 commits April 4, 2026 22:56
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.

2 participants