Canonicalize paths when running tests (#23655)

In the Windows test environment, the paths generated by `temp_tree()`
are symlink paths, which causes certain tests to fail.

I later noticed that when opening a project, we seem to always use
`canonicalize` to normalize the paths, as shown here:
https://github.com/zed-industries/zed/pull/21039.

This PR adopts a similar approach for the test environment to address
the issue.

Release Notes:

- N/A
This commit is contained in:
张小白 2025-01-26 14:56:07 +08:00 committed by GitHub
parent 0f8e2e3811
commit 5d005a7621
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 43 additions and 27 deletions

View file

@ -25,7 +25,7 @@ use std::{
sync::Arc,
};
use theme::ThemeRegistry;
use util::test::temp_tree;
use util::test::TempTree;
#[cfg(test)]
#[ctor::ctor]
@ -470,11 +470,11 @@ async fn test_extension_store_with_test_extension(cx: &mut TestAppContext) {
let test_extension_dir = root_dir.join("extensions").join(test_extension_id);
let fs = Arc::new(RealFs::default());
let extensions_dir = temp_tree(json!({
let extensions_dir = TempTree::new(json!({
"installed": {},
"work": {}
}));
let project_dir = temp_tree(json!({
let project_dir = TempTree::new(json!({
"test.gleam": ""
}));