Skip to content

Fix include path resolution to enable test_include_allows_modifying_parent_mutable_variables #306

Description

@coderabbitai

Problem

The test test_include_allows_modifying_parent_mutable_variables in tests/include_preserves_constness_test.rs is currently marked with #[ignore] due to nondeterministic include/path handling issues.

Root Cause

Include statements are not resolving paths relative to the including file, causing the test to fail when using temporary directories.

Required Fix

  1. Fix include resolution so includes are resolved relative to the including file (rather than current working directory)
  2. Update the parser/loader used by Parser::new / Analyzer::analyze / Interpreter::interpret
  3. Ensure the include loader accepts a base path (the path of the main file) and joins it with the included file path before reading
  4. Make file reads deterministic in the test by passing the resolved path into the parser/interpreter
  5. Remove the #[ignore] attribute so the test runs in CI

Test Location

tests/include_preserves_constness_test.rs, lines 70-118

Backlinks

Activity

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

Metadata

Metadata

Assignees

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