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:
parent
0f8e2e3811
commit
5d005a7621
4 changed files with 43 additions and 27 deletions
|
@ -27,7 +27,7 @@ use unindent::Unindent as _;
|
|||
use util::{
|
||||
assert_set_eq,
|
||||
paths::{replace_path_separator, PathMatcher},
|
||||
test::temp_tree,
|
||||
test::TempTree,
|
||||
TryFutureExt as _,
|
||||
};
|
||||
|
||||
|
@ -67,7 +67,7 @@ async fn test_symlinks(cx: &mut gpui::TestAppContext) {
|
|||
init_test(cx);
|
||||
cx.executor().allow_parking();
|
||||
|
||||
let dir = temp_tree(json!({
|
||||
let dir = TempTree::new(json!({
|
||||
"root": {
|
||||
"apple": "",
|
||||
"banana": {
|
||||
|
@ -106,7 +106,7 @@ async fn test_symlinks(cx: &mut gpui::TestAppContext) {
|
|||
async fn test_editorconfig_support(cx: &mut gpui::TestAppContext) {
|
||||
init_test(cx);
|
||||
|
||||
let dir = temp_tree(json!({
|
||||
let dir = TempTree::new(json!({
|
||||
".editorconfig": r#"
|
||||
root = true
|
||||
[*.rs]
|
||||
|
@ -3187,7 +3187,7 @@ async fn test_rescan_and_remote_updates(cx: &mut gpui::TestAppContext) {
|
|||
init_test(cx);
|
||||
cx.executor().allow_parking();
|
||||
|
||||
let dir = temp_tree(json!({
|
||||
let dir = TempTree::new(json!({
|
||||
"a": {
|
||||
"file1": "",
|
||||
"file2": "",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue