diff --git a/crates/ide-lsp/tests/integration/mock_server.rs b/crates/ide-lsp/tests/integration/mock_server.rs index 1de6176411..39476e8aa0 100644 --- a/crates/ide-lsp/tests/integration/mock_server.rs +++ b/crates/ide-lsp/tests/integration/mock_server.rs @@ -7832,7 +7832,11 @@ async fn gopls_interactive_command_validates_before_execution_and_applies_edits( .await .unwrap(); assert_eq!(created, vec![new_file.clone()]); - assert_eq!(std::fs::read_to_string(&new_file).unwrap(), "package probe_test\n\nimport \"testing\"\n"); + // A created file takes the system line separator (CRLF on Windows). + assert_eq!( + std::fs::read_to_string(&new_file).unwrap().replace("\r\n", "\n"), + "package probe_test\n\nimport \"testing\"\n" + ); } /// bash-language-server formats a whole file with `Position.create(Number.MAX_VALUE, diff --git a/crates/ide-workspace/tests/integration/workspace_edits.rs b/crates/ide-workspace/tests/integration/workspace_edits.rs index 503a3c6ffc..d493f92b96 100644 --- a/crates/ide-workspace/tests/integration/workspace_edits.rs +++ b/crates/ide-workspace/tests/integration/workspace_edits.rs @@ -363,7 +363,8 @@ fn a_server_edit_versions_files_the_editor_never_opened() { assert!(!created.exists()); docs.apply_server_edit(extract(typed)).unwrap(); assert_eq!(docs.snapshot(info.id).unwrap().text, "new\nmore\n"); - assert_eq!(std::fs::read_to_string(&created).unwrap(), "moved\n"); + // A created file takes the system line separator (CRLF on Windows). + assert_eq!(std::fs::read_to_string(&created).unwrap().replace("\r\n", "\n"), "moved\n"); } #[test]