From cf39830e50b385e6ca934bdbb410b1adc296e9e4 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 6843e4c5538095..938da38e349f00 100644 --- a/src/source_code/generator.rs +++ b/src/source_code/generator.rs @@ -1102,7 +1102,7 @@ if True: if True: pass "# - .trim() + .trim().replace("\n", LineEnding::default().as_str()) ); } @@ -1152,7 +1152,7 @@ if True: round_trip_with( &Indentation::new(" ".to_string()), &Quote::default(), - &LineEnding::default(), + &LineEnding::LF(), r#" if True: pass @@ -1163,13 +1163,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 @@ -1180,7 +1180,7 @@ if True: if True: pass "# - .trim() + .trim().replace("\n", LineEnding::default().as_str()) ); assert_eq!( round_trip_with( @@ -1197,7 +1197,7 @@ if True: if True: pass "# - .trim() + .trim().replace("\n", LineEnding::default().as_str()) ); }