mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 06:11:43 +00:00
Fix stale File status in tests (#15030)
## Summary Fixes https://github.com/astral-sh/ruff/issues/15027 The `MemoryFileSystem::write_file` API automatically creates non-existing ancestor directoryes but we failed to update the status of the now created ancestor directories in the `Files` data structure. ## Test Plan Tested that the case in https://github.com/astral-sh/ruff/issues/15027 now passes regardless of whether the *Simple* case is commented out or not
This commit is contained in:
parent
7c2e7cf25e
commit
dcb99cc817
3 changed files with 25 additions and 10 deletions
|
@ -73,6 +73,15 @@ enum SystemOrVendoredPathRef<'a> {
|
|||
Vendored(&'a VendoredPath),
|
||||
}
|
||||
|
||||
impl std::fmt::Display for SystemOrVendoredPathRef<'_> {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
SystemOrVendoredPathRef::System(system) => system.fmt(f),
|
||||
SystemOrVendoredPathRef::Vendored(vendored) => vendored.fmt(f),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Resolves the module for the file with the given id.
|
||||
///
|
||||
/// Returns `None` if the file is not a module locatable via any of the known search paths.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue