Skip to content

Generalize LF normalization for test input fixtures#10

Open
Meredith2328 wants to merge 1 commit intotea-compiler:mainfrom
Meredith2328:pr4-lf-crlf-wildcard
Open

Generalize LF normalization for test input fixtures#10
Meredith2328 wants to merge 1 commit intotea-compiler:mainfrom
Meredith2328:pr4-lf-crlf-wildcard

Conversation

@Meredith2328
Copy link
Copy Markdown

This PR is the same as #4 (which was closed by mistake) and generalizes LF fix to *.in .

When core.autocrlf is configured in Git or when running on Windows,
the expr_eval test reads tests/expr_eval/expr_eval.in and fails
if the file uses CRLF line endings (due to cloning or auto-conversion).

Pic1: expr_eval.in using CRLF, and the test failed
Pasted image 20260327185914

Pic2: expr_eval.in using LF, and the test passed
Pasted image 20260327185936

This pull request updates the .gitattributes file to enforce proper
line ending handling for test input files:

  • Added rule text=auto eol=lf for tests/expr_eval/expr_eval.in

The original fix pinned LF handling to expr_eval.in only. Expanding the rule to all test input fixtures keeps line-ending behavior consistent across Windows checkouts without requiring file-by-file follow-up patches.

Constraint: Test input files under tests/ may be checked out with CRLF on Windows

Rejected: Keep a single-file rule for expr_eval.in | leaves the same risk for other input fixtures

Confidence: high

Scope-risk: narrow

Reversibility: clean

Directive: If a future fixture truly needs platform-native endings, carve it out explicitly instead of narrowing the wildcard

Tested: git check-attr on multiple tests/*.in files

Tested: cargo test expr_eval -- --nocapture (blocked at gcc lookup, not line-ending parsing)

Not-tested: Full cargo test in an environment with gcc available
@hxuhack hxuhack requested a review from Boreas618 April 14, 2026 01:10
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