Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Store goldenfiles with trailing newline (#10900)

Thorsten Ball85b26e97886e
diff --git a/crates/git/src/blame.rs b/crates/git/src/blame.rs
index bb86cb4275b..6b9848609d2 100644
--- a/crates/git/src/blame.rs
+++ b/crates/git/src/blame.rs
@@ -336,8 +336,10 @@ mod tests {
path.push("golden");
path.push(format!("{}.json", golden_filename));
- let have_json =
+ let mut have_json =
serde_json::to_string_pretty(&entries).expect("could not serialize entries to JSON");
+ // We always want to save with a trailing newline.
+ have_json.push('\n');
let update = std::env::var("UPDATE_GOLDEN")
.map(|val| val.to_ascii_lowercase() == "true")
diff --git a/crates/git/test_data/golden/blame_incremental_complex.json b/crates/git/test_data/golden/blame_incremental_complex.json
index 84d49d847b1..3eb6ec81e33 100644
--- a/crates/git/test_data/golden/blame_incremental_complex.json
+++ b/crates/git/test_data/golden/blame_incremental_complex.json
@@ -778,4 +778,4 @@
"previous": null,
"filename": "crates/vim/src/utils.rs"
}
-]
\ No newline at end of file
+]
diff --git a/crates/git/test_data/golden/blame_incremental_not_committed.json b/crates/git/test_data/golden/blame_incremental_not_committed.json
index 0298fb05d37..4e4834d45c5 100644
--- a/crates/git/test_data/golden/blame_incremental_not_committed.json
+++ b/crates/git/test_data/golden/blame_incremental_not_committed.json
@@ -132,4 +132,4 @@
"previous": null,
"filename": "file_b.txt"
}
-]
\ No newline at end of file
+]
diff --git a/crates/git/test_data/golden/blame_incremental_simple.json b/crates/git/test_data/golden/blame_incremental_simple.json
index 4d6e9124d6c..c8fba838972 100644
--- a/crates/git/test_data/golden/blame_incremental_simple.json
+++ b/crates/git/test_data/golden/blame_incremental_simple.json
@@ -132,4 +132,4 @@
"previous": null,
"filename": "index.js"
}
-]
\ No newline at end of file
+]