test(lsp): compare created files without their line separator, everywhere (#8238)

Two more tests (ide-lsp gopls_interactive_command…, ide-workspace a_server_edit_versions_files_the_editor_never_opened) read a file a server edit created and expected LF; on Windows a created file takes CRLF. They fold CRLF to LF like #8233.
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-12-05 22:29:19 +08:00
1 джерело e9480d690c
коміт eefe6cc9c8
2 files changed
+7 -2

No files matched your search

+5 -1
Переглянути файл
@@ -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,
+2 -1
Переглянути файл
@@ -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]