Skip to content

Commit 3558c11

Browse files
KotlinIslandclaude
andcommitted
normalise line ending in the based round-trip test
`based_round_trip` emits the platform line ending, so the multi-line case produced CRLF on windows while the test compared against the LF input. normalise the expected value the same way the other round-trip tests do. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent b8ced6c commit 3558c11

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

crates/ruff_python_codegen/src/generator.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2269,7 +2269,13 @@ if True:
22692269
#[test_case::test_case("x = (a + b)!" ; "force parenthesises looser operand")]
22702270
#[test_case::test_case("x = a?.b" ; "optional chain still works")]
22712271
fn basedpython_wrapped_round_trip(contents: &str) {
2272-
assert_eq!(based_round_trip(contents), contents);
2272+
// `based_round_trip` emits the platform line ending, so normalise the
2273+
// expected value the same way (mirrors the other round-trip tests);
2274+
// otherwise the multi-line cases fail on windows (CRLF vs LF)
2275+
assert_eq!(
2276+
based_round_trip(contents),
2277+
contents.replace('\n', LineEnding::default().as_str())
2278+
);
22732279
}
22742280

22752281
/// infix bitwise-xor must NOT be swallowed by the postfix `^` operator

0 commit comments

Comments
 (0)