Skip to content

Add interpreter regression tests for joined-column option typing#288

Closed
cmontella wants to merge 3 commits intov0.3-betafrom
codex/add-tests-for-type-coercion-in-interpreter
Closed

Add interpreter regression tests for joined-column option typing#288
cmontella wants to merge 3 commits intov0.3-betafrom
codex/add-tests-for-type-coercion-in-interpreter

Conversation

@cmontella
Copy link
Copy Markdown
Member

Motivation

  • Cover a regression where joined-table column lookups should yield option-typed values (u8?) and unwrap to u8 when matched.
  • Capture a coercion bug where an option-match wildcard arm (| * => 0.) is inferred as f64 instead of being coerced to the first arm's integer kind (u8).

Description

  • Added three tests to tests/interpreter.rs (guarded by #[cfg(all(feature = "u8", feature = "u64"))]) that exercise joined-column lookups and option matching.
  • The new tests are interpret_joined_column_lookup_infers_option_for_present_value, interpret_joined_column_lookup_infers_option_for_missing_value, and interpret_joined_column_option_match_uses_first_arm_type_for_wildcard_coercion, and they assert expected u8 results via the test_interpreter! macro.
  • The tests exercise both present and missing joined values and a failing coercion case where the wildcard fallback should be coerced to u8.

Testing

  • Ran cargo test --test interpreter interpret_joined_column -- --nocapture, which executed the three new tests.
  • Two tests passed (interpret_joined_column_lookup_infers_option_for_present_value, interpret_joined_column_lookup_infers_option_for_missing_value) and one test (interpret_joined_column_option_match_uses_first_arm_type_for_wildcard_coercion) failed, reproducing the reported coercion bug.
  • The failure is expected and documents the bug for follow-up fixes so the test suite can be used to verify a future fix.

Codex Task

@cmontella cmontella closed this Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant