From 59b7f9c0b61032a73418f24c023e774544d7fcec Mon Sep 17 00:00:00 2001 From: Simon Brugman Date: Sat, 21 Jan 2023 17:00:41 +0100 Subject: [PATCH] fix: use platform-specific literal newlines see https://github.com/rust-lang/rust/issues/62865 --- src/source_code/generator.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/source_code/generator.rs b/src/source_code/generator.rs index 87dffb36ebfb1a..dca3c95d0719cb 100644 --- a/src/source_code/generator.rs +++ b/src/source_code/generator.rs @@ -1192,7 +1192,7 @@ if True: if True: pass "# - .trim() + .trim().replace("\n", LineEnding::default().as_str()) ); } @@ -1242,7 +1242,7 @@ if True: round_trip_with( &Indentation::new(" ".to_string()), &Quote::default(), - &LineEnding::default(), + &LineEnding::LF(), r#" if True: pass @@ -1253,13 +1253,13 @@ if True: if True: pass "# - .trim() + .trim().replace("\n", LineEnding::default().as_str()) ); assert_eq!( round_trip_with( &Indentation::new(" ".to_string()), &Quote::default(), - &LineEnding::default(), + &LineEnding::LF(), r#" if True: pass @@ -1270,7 +1270,7 @@ if True: if True: pass "# - .trim() + .trim().replace("\n", LineEnding::default().as_str()) ); assert_eq!( round_trip_with( @@ -1287,7 +1287,7 @@ if True: if True: pass "# - .trim() + .trim().replace("\n", LineEnding::default().as_str()) ); }